Spurious excel.exe processes

byrnedhead

New Member
Joined
Aug 15, 2007
Messages
1
This is a rather esoteric problem, but I hope someone can help me.

I'm working on a VBA macro which exports a few MS Access query tables to an Excel workbook and then does extensive formatting to turn the data into a human-readable report. I'm opening Excel from within Access thus:
Code:
Dim NewExcel As New Excel.Application
    NewExcel.Visible = True
The problem is that when the user closes Excel after the macro has run, the excel.exe process does not get terminated. If the macro is run more than once, then VBA throws error 91, "Object variable or With block variable not set", at several places in the VBA code. This usually involves references to the ActiveWorkbook property; I'm guessing that the VBA is confused by the multiple excel.exe processes. I can re-write the code to clarify any references that have this problem, but it would be better if the excel.exe processes just closed normally like they're supposed to. Is there an alternate method of opening Excel that doesn't have this problem?

Thanks for any help. This is all in Excel/Access 2003.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,214,819
Messages
6,121,746
Members
449,050
Latest member
excelknuckles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top