- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SaveChanges%VT = VT_BOOL
SaveChanges%VU%BOOL_VAL = VARIANT_BOOL_FALSE
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fortran] TYPE VARIANT SEQUENCE INTEGER*2 VT INTEGER*2 RESERVED1 INTEGER*2 RESERVED2 INTEGER*2 RESERVED3 RECORD /VARIANT_UNION/ VU END TYPE VARIANT INTEGER*2, PARAMETER :: VARIANT_BOOL_TRUE = -1 INTEGER*2, PARAMETER :: VARIANT_BOOL_FALSE = 0 TYPE (VARIANT) :: OPTIONAL_VARIANT[/fortran]This tells me that you want something like this:
SaveChanges%VT = VARIANT_BOOL_FALSE
I have not tested this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SaveChanges%VT = VT_BOOL
SaveChanges%VU%BOOL_VAL = VARIANT_BOOL_FALSE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fortran]
SUBROUTINE CloseExelwithoutSaving(status)
IMPLICIT NONE
INTEGER(4),intent(out) :: status
type(VARIANT) :: SaveChanges
status=-1
if(workbook.eq.0) return
SaveChanges%VT = VT_BOOL
SaveChanges%VU%BOOL_VAL = VARIANT_BOOL_FALSE
!call $Workbook_Close(workbook, SaveChanges, Filename, RouteWorkbook, $STATUS)
call $Workbook_Close(workbook, SaveChanges=SaveChanges, $STATUS=status)
if(status.ne.0) return
call Workbooks_Close(workbooks, status)
END SUBROUTINE CloseExelwithoutSaving
[/fortran]
Anyone solve this problem? With the code above (the undeclared stuff is from the module variables BTW) the $Workbook_Close closes the worksheet leaving and empty excel window. Adding the Workbooks_Close closes the excel session but *only* when I exit the application that created it!
aNY

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page