closing excel in access (1 Viewer)

FireStrike

Registered User.
Local time
Today, 14:36
Joined
Jul 14, 2006
Messages
69
I have a form that takes data from a database, and creates a report in excel. I finally have this working. The problem is that when it is done, I close the workbook, but it never closes excel. Excel still runs in the background and does not let go of the file. So far the only way I have found around this is to open the task manager and kill the excel process. here is the code I have to open and close it, can someone help?

Set excApp = New Excel.Application
Set wb = excApp.Workbooks.Open(strFileName)
wb.Close acServerView, , acSaveYes


I have also used just

wb.close

and ran into the same problem:(
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 11:36
Joined
Aug 30, 2003
Messages
36,127
Try:

wb.Quit
 

FireStrike

Registered User.
Local time
Today, 14:36
Joined
Jul 14, 2006
Messages
69
Using the trick on the tread I was able to get Excel to release my report file:) But I was unable to get it to stop the rogue excel processes that keep popping up. But that is of no big deal to me. I can deal with that:) thank you both:)
 

Bodisathva

Registered User.
Local time
Today, 14:36
Joined
Oct 4, 2005
Messages
1,274
using the set=nothing will get it to release the report, but you need to issue the Application.Quit command to terminate the instance of excel you originally created.
 

Users who are viewing this thread

Top Bottom