Results 1 to 5 of 5

Thread: PowerPoint - Informing other application that VBA macro is finished

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2012
    Posts
    245

    PowerPoint - Informing other application that VBA macro is finished

    Hi,

    My VB6 application links with PowerPoint, creates a new deck based on a template, populates the slides, and then starts a VBA-macro to allow further customization of the deck. That works fine when creating one deck, but now this must be done in batch.

    To ensure that all works well, these decks need to be processed one after another, so the question becomes how the "calling app" knows that PowerPoint is finished processing the VBA macro of a deck before starting the next.

    A simple way could be to set a value in a registry entry, of create a dummy file like "finished.txt", and put the calling app in a waiting loop until the file pops up, or the registry value changes, but I was wondering if there is a more "advanced" way to do this.

    Thanks in advance,
    Erwin

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,393

    Re: PowerPoint - Informing other application that VBA macro is finished

    That might depend on what you might consider "more advanced". VBA can do most of what VB6 can, so it might be possible to have the VBA code send information directly to your VB6 program to indicate that it has finished with each file.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2012
    Posts
    245

    Re: PowerPoint - Informing other application that VBA macro is finished

    Hi jdc2000,

    I figured that there could be some way for the VBA code to send back a "signal" to the calling app, but have no clue other than "setting a flag" in the registry or with a file. Do you have a suggestion? Even if it's just conceptually, giving me a direction to search.

    E.g. is there way for the calling app to see that the VBA code is still running in PowerPoint?

    Or are you thinking for the VBA code to raise an event / change a variable in the calling app?

    Regards,
    Erwin

  4. #4
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,393

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: PowerPoint - Informing other application that VBA macro is finished

    there are probably several solutions to this

    i would look at moving the code to create the deck to vba macro, just pass parameters to how many decks and other information to the macro, call the existing macro from the first one, which will not proceed to create new deck until the processing code is completed

    another option would be to automate powerpoint with events
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width