Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automatically close all Excel workbooks without saving
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00976227
Message ID:
00976325
Views:
14
FOR i = 1 TO o.Workbooks.count
o.Workbooks.item(i).close(.f.)
NEXT

>Thanks!  How could I iterate through all the workbooks to close them all without saving changes?
>
>>How about
>><pre>o = CREATEOBJECT("excel.application")
>>owb = o.Workbooks.Open("c:\book1.xls")
>>owb.Close(.f.)  && Do not save changes
>>o.Quit
>>
>>
>>>How to automatically close all Excel opened workbooks without saving it?
>>>
>>>I would like to do this in the finally section in the try-catch block before quiting Excel so that it would get stuck with an "Do you want to save your workbook?" Dialog.
>>>
>>>Thanks!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform