Disable Macros

L

Lorikeet1

I've created a document management system for my company, and have
recently turned it into an add in..

Currently I can "Open existing Jobs" using a macro, but these jobs have
macros inside them which are redundant as the macros I'd like to use
are in the add-in.

Is there a way, in code, to disable macros on a certain workbook?
(ActiveWorkbook.macroOptions, or something)?

Thanks!
 
M

Michael Herzfeld

If I understand your question correctly, yes, there is a way to disable
macros when you open a workbook programmatically. Just add the following
line of code before the code that opens the workbook:

Application.AutomationSecurity = msoAutomationSecurityForceDisable

Since this is an application-wide setting, it's usually best to set it
back to its default setting (msoAutomationSecurityLow) after the file is
opened.

Michael Herzfeld
Office Programmability Test Team


-----Original Message-----
From: (e-mail address removed) [mailto:[email protected]]
Posted At: Tuesday, September 27, 2005 9:39 AM
Posted To: microsoft.public.office.developer.vba
Conversation: Disable Macros
Subject: Disable Macros

I've created a document management system for my company, and have
recently turned it into an add in..

Currently I can "Open existing Jobs" using a macro, but these jobs have
macros inside them which are redundant as the macros I'd like to use
are in the add-in.

Is there a way, in code, to disable macros on a certain workbook?
(ActiveWorkbook.macroOptions, or something)?

Thanks!
 

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