Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extra basic opens & closes excel, but other .xls are unable to load

Status
Not open for further replies.

Maltor

Programmer
Feb 10, 2004
3
CA
I have a macro that starts in Attachmate Extra!, gets needed information, Opens excel, opens a file in excel then puts the information into a worksheet and prints. The macro then closes the workbook and quits excel. It then continues performing actions in Extra!

The Problem is after running the macro, every time I try to open an excel file with a macro, excel freezes.

Skeleton:

Set objSys = GetObject(Extra.System)
...
Set objExcel = CreateObject(Excel.Application)
Set objWork = objExcel.workbooks.Open("H:\file.xls")
...
Print ...
...
Call objWork.Close()
Call objExcel.Quit()
...
Main

 
It may be that you do not clean up fully. Objects are retained in memory until cleared by code. So Quit the application then Set them all =Nothing in the reverse order that they were created.


Regards
BrianB
Use CupOfCoffee to speed up all windows applications
================================
 
Sorry, I forgot to put that directly following objExcel.Quit()
is
Set objExcel = Nothing.

Thanks for the help though.
I don't set my Extra! object to nothing as I still want Extra! to be open after the macro runs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top