Urgent: How to prevent opening Excel file that contains macros

K

kvenku

I have a Excel file which inturn create a toolbar with new icons when
open the excel file. I wrote a function to open a excel file for impor
and export.

I need to avoid opening a excel file that contains macros.. how to d
this

Thanks

Venkates
 
T

Tom Ogilvy

Perhaps you only want to supress the running of the workbook_Open macro

Application.EnableEvents = False
Workbooks.Open "C:\Myfolder\MyfilewithWorkbook_OpenMacro.xls"
Application.EnableEvents = True

or if it has other events like selectionchange or change you can leave
events off until you are through processing the workbook.
 
A

Arkimediz

You could go to Tools - Macros - Security and set security
to medium and say to enabling when sheet is loaded
 

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