Consulting

Results 1 to 2 of 2

Thread: VBA not getting executed in .ppsm file

  1. #1
    VBAX Newbie
    Joined
    May 2017
    Posts
    1
    Location

    VBA not getting executed in .ppsm file

    Hello,

    I have following VBA code in powerpoint 2007:

    Sub OnSlideShowPageChange()
    On Error GoTo ErrLog
        Dim i As Integer
        
        If Format(Date, "dd/mm/yyyy") = Format(CDate("21/5/2017")) Then
            'Run the Slide
           msgbox "Running"
        Else
             msgbox "Exiting"
            ActivePresentation.SlideShowWindow.View.Exit
        End If
        Exit Sub
        
    ErrLog:
        MsgBox Err.Description
    End Sub
    i..e I want that this powerpoint .ppsm file run only on 21st May 2017. On other dates, it should exit. I save my pptm file and also saved in .ppsm format. When my pptm file is open, and I run .ppsm file from Windows Explorer, VBA code executes. But if I exit my .pptm file and then run .ppsm file from Windows Explorer, VBA code does not execute. Why?

    Please Help....
    Last edited by Paul_Hossler; 05-24-2017 at 08:19 AM. Reason: Added [CODE] tags

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    The method you are using is from PPT 97 and it is not reliable. You can help by inserting any object from the control toolbox (Say an activX command button ) on slide 1 and set it to not visible with the selection pane.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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