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

Excel won't go away 1

Status
Not open for further replies.

dtran

Programmer
Jun 25, 2001
29
US
I am doing a "createObject("Excel.Application") in VB.
With the workbook and worksheet and everything works fine.
When I try to popoluate the excel sheet from an access db with "querytables.add(Connection:=rs, Destination:=("A1") where rs is the recordset that holds the connection to the db. And that works fine but my problem is that when I call it again it crashes. The application and the excel application is not up and running but on the task manager there seem to be an instance of it still up with is keeping me from running my app again. The error is: "The remote server machine does not exist or is unavailable. runtime error 462".
Please help.

Thanks in advance
 
Try setting your Excel Object = Nothing
And doing an ExcelObject.Quit
 
I tried that.
I set everything I have to nothing, even the recordset and connection string and the db and everything I have. But still that problem.
even tried the application.quit
 
the easier way to do this is as follows:

Add the Excel Object Library to your project. (Project-References)
Code:
Dim oExcel as new Excel.Application
......
Fill in rest of code here.
......
Code:
oExcel.Quit
Set oExcel = Nothing

I have done extensive Excel automation and this has worked for me without issue.

--NipsMG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top