autorunning macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

PPT 2003.
Macros seem to be a different animal in PPT than in Excel, Access, etc. For
example:

1. How do I create an "autorun" macro? Online helped infers that I need to
create a Application object in a class module, then initialize it so that
events can run:
Dim X As New EventClassModule
Sub InitializeApp()
Set X.App = Application
End Sub

Ok. If I MANUALLY run this procedure, I can get my event procedures to fire.
But how do I get the initializeApp routine to AUTOMATICALLY run? It seems
rather silly to have to manually run a macro so that event macros can run!!
Am I missing something here?

All I want to do is run a procedure for both the slideshowbegin and
slideshowend events without manual interaction.

Thanks!

George
 
As I tried to infer from my message, I did follow the steps of that KB
article. The question that I have is: How to I initiate the initialization
macro automatically? I'm speaking of:
Dim X As New EventClassModule
Sub InitializeApp()
Set X.App = Application
End Sub

Which the note says I need to run to make the events work. I have to have
this macro run automatically, to initialize the event class module, so I
understand from the article. Obviously, I must be misunderstanding something.
I have a PPT with an event class module, event modules and the initialization
macro to activate the events. What runs the initialization macro?

George
 
Sorry, I thought you were referring to having read a Microsoft Help file,
not the PPT FAQ (which is not the same as the Microsoft Knowledge Base).
The entry in the PPT FAQ states:

An Event handler cannot be set automatically. To set an event handler
when PowerPoint starts up you still need to rely on the Auto_Open macro
of an add-in to instantiate the event handler.

Perhaps, Steve and/or Shyam can shed some more light on this as they are
more expert in this area than I.

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
Thanks for the reply. I can't believe that the VBA implementation in PPT is
still so immature that it cannot support inherent auto-macros, like Excel,
Word and Access. This is especially galling, considering the ability to
create "stand-alone" PPS slide shows, for example. Well, I'm not telling you
anything you don't know, of course.

George
 
GeorgeAtkins said:
Thanks for the reply. I can't believe that the VBA implementation in PPT is
still so immature that it cannot support inherent auto-macros, like Excel,
Word and Access.

You'll have to make a few adjustments to your belief system then. ;-)

PowerPoint will automatically run Auto_Open / Auto_Close subs only when they're
included in Add-ins (PPAs). Then Auto_Open runs when the addin loads and only
then.

There's more at http://www.pptfaq.com and http://skp.mvps.org about creating
and using add-ins. Use the search feature at either site to find relevant
info.
 
Thanks for the links, Steve. I'll check them out.

However, I'll stand by my opinion: Having to create an add-in in order to
to fire an Auto-Run macro that is necessary to run an initialization macro in
order to allow PowerPoint to respond to event macros seems like the king of
kludges to me.
 
Thanks for the links, Steve. I'll check them out.

However, I'll stand by my opinion: Having to create an add-in in order to
to fire an Auto-Run macro that is necessary to run an initialization macro in
order to allow PowerPoint to respond to event macros seems like the king of
kludges to me.

Now now ... I didn't suggest that YOUR belief system was wrong or that I disagreed
with it. Just that it and PowerPoint don't see eye to eye. I'm with *you* <g>

For test purposes, you can run code that sets an event trap from within a PPT; you
don't actually have to resort to an add-in, but the concept of scope gets very
jelloteric when you're running non-addin code in the IDE. You may have to run the
code that sets the trap after every break, for example.

For testing, that's not too horrible; for code you're going to turn loose on the
world, it's a non-starter, of course.
 

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

Back
Top