Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP/Excel question - Closing Excel sheet
Message
 
To
18/11/1999 10:45:44
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00292412
Message ID:
00292521
Views:
28
>If you do background work then it's OK.
>oExcel.ActiveWorkbook.Saved = .t. && Prevent prompt
>oExcel.Quit
>
>If it's made visible so that user can intervene, different results occur depending type of closure (Close workbook - Ctrl+F4 or Close excel - Alt+F4).
>There should be smarter ways but currently what I do is to check if I can fopen() the xls file and don't release the oExcel till I can (workbook closed). Otherwise I get crash if the user exits with Ctrl+F4 and oExcel is released already. If I declare it public then it's another story :)

Hi Cetin - I was wondering about that. I haven't had time to test the Quit yet, but I may have some problems here, not sure. It's always a new Visible sheet of data the user will be starting with, but then they can edit it, save it any way or name they want, or just close it without doing any edits.

Maybe I can just check TYPE of oExcel (a form property) at form closing time, and issue Quit if it's still 'O'. I'll have to test some, then re-post if I have any difficulties here...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform