Problem w/Killing Excel from Access

K

Kev

Can anyone help me out with this one?
I am trying to populate a spreadsheet with some data from Access. All code resides in Access. My problem is after I run the code below; Excel continues to run in the background. I have tried to delete the Quit Method and set the Visible Property to True and then manually close the application. But when I check the Task Manager, I still find Excel.exe running in the background.

Dim xlJEs As Excel.Application

Set xlJEs = New Excel.Application
xlJEs.Workbooks.Open strJETemplate

strSaveAsJeName = "JrnlEntrySalesTax" & Year(Date) & Month(Date) & ".xls"
ActiveWorkbook.SaveAs Filename:="C:\PS\84Jrnl_Uploads\" & strSaveAsJeName, FileFormat:=xlNormal
xlJEs.Application.Quit
Set xlJEs = Nothing

Does anyone have any ideas?


Thanks,

Kev
 
S

Stan Scott

Kev,

For reasons I'm not sure I understand fully, there's an issue with using the
"New" method here. Replace your Set statement with "Set xlJEs =
CreateObject("excel.application")". You'll need to Dim the xlJEs variable
as a generic object, of course, but that should solve the problem.

Stan Scott
New York City

Kev said:
Can anyone help me out with this one?
I am trying to populate a spreadsheet with some data from Access. All code
resides in Access. My problem is after I run the code below; Excel continues
to run in the background. I have tried to delete the Quit Method and set the
Visible Property to True and then manually close the application. But when I
check the Task Manager, I still find Excel.exe running in the background.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top