Auto_Open macros "dies" when processing PowerPoint files with macros

V

vba_nerd

Hi,

I have code that processes several PowerPoint presentations. I open the each
of the presentations read-only with no window and do some processing on
them.

But whenever a presentation with macros is processed and the macro's prompt
shows, if I choose "Disable macros" the whole processing presentation loop
dies. It's almost like clicking on the End button in IDE.

If I choose "Enable macros" in the presention currently being processed it
works like a charm....

It seems that "Disable macros" also disable my ppa macros....

I have tried shifting the automation security with no success. Using Office
2003 SP2
 
S

Steve Rindsberg

Hi,

I have code that processes several PowerPoint presentations. I open the each
of the presentations read-only with no window and do some processing on
them.

But whenever a presentation with macros is processed and the macro's prompt
shows, if I choose "Disable macros" the whole processing presentation loop
dies. It's almost like clicking on the End button in IDE.

If I choose "Enable macros" in the presention currently being processed it
works like a charm....

It seems that "Disable macros" also disable my ppa macros....

I have tried shifting the automation security with no success. Using Office
2003 SP2

If you haven't already done so, set macro security to LOW, quit and restart
PPT, then try again. Does that help?
 
V

vba_nerd

Yes, thanks that helped! :)

Still this behaviour of Office seems a bit odd to me...
Steve, have you seen this before?

I suppose if I rewrite the code as a vb file it probably works with no
problems.

The application.automationsecurity didn't helped me either when Macro
security was set to Medium.

/Bjorn
 
S

Steve Rindsberg

Yes, thanks that helped! :)

Still this behaviour of Office seems a bit odd to me...
Steve, have you seen this before?

No, but to be honest it always struck me as a bit odd that my code could open a
presentation with macros in it even though the user's security settings would
prevent them from doing it (with macros enabled) manually.

I wonder if MS has changed this in a recent SP.
I suppose if I rewrite the code as a vb file it probably works with no
problems.

The application.automationsecurity didn't helped me either when Macro
security was set to Medium.

I wouldn't expect it to ... Medium means "Ask the user if it's ok to open a
presentation with macros in it". That's why I suggested trying Low instead.
 
S

Shyam Pillai

Have you tried:

Dim secAutomation As MsoAutomationSecurity
Dim oPPT As Presentation
secAutomation = Application.AutomationSecurity
Application.AutomationSecurity = msoAutomationSecurityForceDisable
Set oPPT = Presentations.Open(FileName:="C:\Presentation.ppt",
WithWindow:=False)
Application.AutomationSecurity = secAutomation
MsgBox "It's Open and ready for processing!"

Does that work for you?
 

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