Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel left open even after close/save
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01097362
Message ID:
01097614
Vues:
14
Thanks for whatever checking / verifying on your end... At least its not me going nuts trying to see why it won't close.


>It seems to be Excel version and OS version dependent. We have some servers running W2K and using Excel 2000, and they don't hang around. Same code running on XP with Excel 2002, it hangs around. Not sure what it takes to guarantee that Excel "goes away" properly.
>
>
>>Hi all, I have a problem with Excel Automation... Don't know what I'm missing. Basically, I'm reading and processing data in an excel file so I only need as read-only and not changing ANY values, and close when finished. When I'm done, I QUIT the excel object, and even set to null when done. When I look at the Task Manager, Excel is still listed as open. So, to test whats happening, I have included each incremental change that I do.
>>
>>With the EXCEPTION of the first pass where I just create the object and quit, all others keep Excel open in the task manager. When I try to launch the process again, it hangs.
>>
>>
>>THIS IS THE ONLY ONE WHERE EXCEL IS CLEAR FROM TASK MANAGER...
>>oEX = CREATEOBJECT( "Excel.Application" )
>>oEX.Quit()
>>RETURN
>>
>>
>>All the rest of these itterations keep excel open
>>
>>oEX = CREATEOBJECT( "Excel.Application" )
>>oEX.Workbooks.Open( "c:\SomeExcelFile.xls" )
>>oEX.Quit()
>>RETURN
>>
>>
>>oEX = CREATEOBJECT( "Excel.Application" )
>>oEX.Workbooks.Open( "c:\SomeExcelFile.xls" )
>>oEX.ActiveWorkbook.Saved = .T.  && force fake flag that workbook was saved, even though nothing touched
>>oEX.Quit()
>>RETURN
>>
>>
>>oEX = CREATEOBJECT( "Excel.Application" )
>>oEX.Workbooks.Open( "c:\SomeExcelFile.xls" )
>>oEX.ActiveWorkbook.Saved = .T.  && force fake flag that workbook was saved, even though nothing touched
>>oEX.ActiveWorkbook.Close(.f.)
>>oEX.Quit()
>>RETURN
>>
>>
>>oEX = CREATEOBJECT( "Excel.Application" )
>>oEX.DisplayAlerts = .F.  && force to ignore alert of "Save change" on exit
>>oEX.Workbooks.Open( "c:\SomeExcelFile.xls" )
>>oEX.ActiveWorkbook.Saved = .T.  && force fake flag that workbook was saved, even though nothing touched
>>oEX.ActiveWorkbook.Close(.f.)
>>oEX.Quit()
>>RETURN
>>
>>
>>oEX = CREATEOBJECT( "Excel.Application" )
>>oEX.DisplayAlerts = .F.  && force to ignore alert of "Save change" on exit
>>oEX.Workbooks.Open( "c:\SomeExcelFile.xls" )
>>oEX.ActiveWorkbook.Saved = .T.  && force fake flag that workbook was saved, even though nothing touched
>>oEX.ActiveWorkbook.Close(.f.)
>>oEX.Quit()
>>oEX = NULL
>>RETURN
>>
>>
>>
>>
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform