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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object help

Status
Not open for further replies.

cmz21

Programmer
May 5, 2005
110
US
Hello,
I am creating an Excel sheet from access queries using vba. Everytime I run the report, I have an instance of Excel running in the background until I close Access. I realize that I have to set all objects = nothing. Is there a way to find out what objects are present? I feel as though I am closing everything, but I must be missing something.

Any thoughts would be great.

Thanks
cmz
 
Try adding the following:

MyExcelObj.Quit ' Whatever name you used.



"Hmmm, it worked when I tested it....
 
I understand that....my problem is that I'm not sure what object is left. I have closed most objects, but still have the instance of excel running.
 
Is this the proper syntax for closing out these objects?

Excel.Workbooks.Close
Set xlSheet = Nothing
Excel.Application.Quit
Set Application = Nothing
 
I have never, ever used anything like that. You may find some other approaches through search here, for instance look at the instantiations/close and relaease here thread705-938460 (my reply is a short one, but illustrates my preferred way of refering to the word application object and child objects, which is the same way I'd work with Excel objects). You will find that approach rather close to the link I posted, and somewhat different from your appraoch.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top