Disable Macros when calling MS Project via automation

W

WGHayes

Dear Reader,

We are trying to avoid the 'Macro Warning' that is prompted when running MS
Project if there are macros/VBA code. We have looked at the various
security models available to manage this in MS Project and have identified
the following parameter that can be used to LOWER security via automation:-

MSProject.Application.AutomationSecurity = AutomationSecurityLow
(Where:- AutomationSecurityLow = 1)

This seems to work okay in most circumstances but seems to be ignored when a
resource pool file is opened automatically as a result of opening a sharer
file (i.e. with a method that opens the pool file as well).

Our requirement is to make the automation process seamless to the user of
our application software. Any action/activity in our application will
result in some processing, via automation, with MS project. Ideally we do
not want the user having to acknowledge prompts generated by MS Project.

Previously we have managed to overcome any 'prompts' that MS Project may
have raised by using the 'SendKeys "{ENTER}' approach. This works okay when
the application is NOT visible, however, when a SHARER file opens that
requires a POOL file to be opened, MS project becomes visible on the taskbar
for both MS Projects (not ideal, but unavoidable as far as I can see due to
the Project Sharer options).

My questions are:-

Q1 - Has anyone had this problem or similar using the 'AutomationSecurity '
option?

Q2 - What other options could be considered for handling the 'Macro
Warning'?

Q3 - Has anyone been able to STOP MS Project becoming VISIBLE when a sharer
and pool project are opened together (i.e. how can you HIDE these MS
projects when called from automation)?

Any advise and feedback would be appreciated.

Regards,
WGH.
 
R

Rod Gill

Hi,

Have you tried the Application.DisplayAlerts=False method? You can also use
Application.Visible=False to hide it.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
 

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