View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Disable macro through automation

Scott

I think you need:

Application.EnableEvents=False
' your code
Application.EnableEvents=True

or the equivalent in VB.NET

Regards

Trevor


"Scott Wallace" wrote in message
...
Is there a way to disable macros when calling Excel through a language

such
as VB.NET? I've got an Excel file that has macros that run on startup. I
don't want the macros to fire when I open through VB. I can't seem to

find
a property or setting in Excel that simply says to disable all macros from
running. Yes, I do want to disable all macros either through a setting in
Excel or through the automation, so please - no comments on why I might

not
want to do this.

Thanks,
Scott