Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable macro 2

Status
Not open for further replies.

zg

Programmer
Oct 11, 2002
3
SE
Hello!

When you start an excel file with macro a warning pop up.

My problem: I have excel with macro. When I open the file
from Internet Explorer (I mean excel is embedded in IE)
I would like to completely disable(eliminate) macro so I
don't get the warning. It should behave as ordinary excel
without macro.

Is there a way to fix this?

Thanks, Zeljko
 
I asked the same question a few days ago (see thread about Disabling Workbook_Open Event). Manually, you can hold the shift key while the excel file opens and macros will be disabled. From VBA, Application.EnableEvents = False will disable ALL events, so it must be reset to True. See the previous post for more input from other developers.

Hope this helps!
 
Hi,

the basic question is:
How does excel know if it was started
from InternetExplorer?

Zeljko
 
Could you not, in excel, create an iexplorer object, match it to the calling iexplorer and check if the webpage currently open is the one that calls the workbook? Then you could just exit sub. Of course, you'll have to deal with multiple instances of iexplorer open.
This is just a suggested avenue of approach. If there's an easier way, feel free.
 
Hi!
I found a very easy way to fix the problem.
I use property Application.UserControl.
It sets:
TRUE - when user starts excel directly
FALSE - when we start excel from other application

zg

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top