Open Worbook and Disable Macros

D

DMc2005

I know how to open a workbook using VBA, but how do i open a workbook and
disable its macros.

D
 
R

R. Choate

First, just open Excel by itself and disable macros (Tools>Macros>Security, etc.). Then open the workbook with the macros you don't
want to run.

HTH
--
RMC,CPA


I know how to open a workbook using VBA, but how do i open a workbook and
disable its macros.

D
 
D

DMc2005

I am running a macro from a file that opens several other files and enters
data into these files. however these files have macros in them.

so essentially i need to keep macros in my main workbook. but disable the
macros in the other workbooks. i cannot rely on users clicking disable
macros.

D
 
T

Tom Ogilvy

If you want to suppress a Workbook.Open Event

Application.EnableEvents = False
workbooks.Open "C:\MyFolder\Mybook.xls"
Application.EnableEvents = True

This doesn't disable events in the workbook, but it does stop the open event
from running. Leave events disabled if you want to suppress other events.
 
Top