Discussion Locked

VBA Programming

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

This one is for PowerPoint specifically, and hopefully any other MSOffice app. I want a macro to fire up when a document (powerpoint) is opened to make sure that the file being opened is the latest version of the file on our network. Is there an event that can be called to execute when a file is opened? More specifically, I am doing this through OLE automation and want to know if, when I call a file to be opened through OLE, the macro will fire when it is opened?

Thanks

George

7 replies

by shanghai sam

That web reference was the first one to come up on a basic google search. I need some specifics that the web site doesn't provide.

by cogsdalesoftware

Here's an answer, possibly not the one you would like to see: In other Office apps, there is a way to fire off macros when the document is opened (e.g. in Excel, create a sub named Workbook_Open in the ThisWorkbook module - this runs when the doc opens) However, in my experience I have never been able to find means to do this in PowerPoint.
You can hack around this by firing your code from a VBA button which you can place on the first slide.
In response to the second question, yes, the macrosin Excel, etc will run even when called using OLE.
Hope this helps
-Keir

by cedric king

By knowing which event is called when a file is opened, doesn't necessary means that you will be able to get the latest copy of the file on the network. Maybe you could try to create a .exe which finds the latest file on hte network, then opens up that file. I believe that would be a much simpler method.

This discussion is closed to new replies.