disable Excel AutoExec macro when opening via Access Automation

D

Dale Fye

How can I disable the AutoExec macro within an Excel workbook, when I open
it via automation?
 
D

Dale Fye

Actually, when I looked at it more closely, the code is in the
Workbook_Activate event.

Is there any way to prevent this event from firing when I open the Excel
file from Access via automation?
 
K

Ken Snell \(MVP\)

Here's one suggestion that might work:
http://vbadud.blogspot.com/2007/10/disabling-macros-in-workbook-excel-vba.html


I have not done EXCEL programming for a few years now, but somewhere in the
back of my mind is a memory that there is a code step one can run at the
beginning of VBA that will inhibit the running of events in EXCEL.... but, I
cannot find that info in my archived files. And I don't find it via a Google
search either. If I find it, I'll post it here for you.

--

Ken Snell
<MS ACCESS MVP>
 
K

Ken Snell \(MVP\)

Left out a bit of the code:

'disable events
Excel.Application.EnableEvents = False

'enable events
Excel.Application.EnableEvents = True
--

Ken Snell
<MS ACCESS MVP>
 

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