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
 
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

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