Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP/Excel question - Closing Excel sheet
Message
De
18/11/1999 13:20:45
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00292412
Message ID:
00292566
Vues:
22
I don't like to make an Automation object visible. It seems that 90% of the errors that happen that will cause you to shutdown everything happens when the user closes the app while VFP still has an object reference to it.

I would think that with the time you are saving these folks by creating the spreadsheet, it won't hurt them too much to run your operation to create it, then start Excel and open the sheet.

PF

>>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...

(On an infant's shirt): Already smarter than Bush
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform