• PowerPoint 2003 macro error

    Author
    Topic
    #487111

    PowerPoint Macro Question

    I am using PowerPoint in MS Office 2003.

    I recorded a macro while working on a presentation and I seem to recall it asking me where I wanted to save the macro. I chose the option “save in document” or something like that.

    The macro takes the selected photo, moves it to the front, Using the Draw option in a toolbar; then puts a green frame around it using the Format>Picture -> Color and Lines Tab -> drop down Color select color, change Weight value (line thickness);Then I Click on STOP Recording Macro.

    This document became huge (over a Gig) and cumbersome to use, so I did a ”Save As” and created a new document and deleted a bunch of slides and proceeded to continue with creating the presentation. (As info, I will use the compress option to reduce the presentations later and save under a different name for use when I run them.)

    I continued creating the slide show in the new document. When I went to run the macro, I get the following error.

    32752-PowerPoint-Macro-Error-01

    I also get the windows popping up below.

    32753-PowerPoint-Macro-Error-02

    I have recorded new macros duplicating the first macro that worked but the resulting behavior is not what I recorded.

    One version of the macro just moves another graphic on the slide. Another version puts the green frame around the wrong graphic.

    Does anyone have any suggestions on how to make it work?

    Viewing 0 reply threads
    Author
    Replies
    • #1366434

      The macro recorder in PowerPoint nearly always comes up with code you cannot use in a real situation. Sometimes it’s a useful pointer but rarely if ever robust usable code.

      Try this code instead:

      (ALT f11 to open the vb editor
      Delete the existing code and paste in this)

      Sub ab4Pic()
      If ActiveWindow.Selection.Type = ppSelectionNone Then GoTo err1
      If ActiveWindow.Selection.ShapeRange.Count 1 Then GoTo err2
      With ActiveWindow.Selection.ShapeRange(1)
      .Line.Weight = 1.5
      .Line.ForeColor.RGB = RGB(0, 255, 0)
      .ZOrder (msoBringToFront)
      End With
      normalexit:
      Exit Sub
      err1:
      MsgBox “You don’t have anything selected!”, vbCritical
      GoTo normalexit
      err2:
      MsgBox “Select ONE shape!”, vbCritical
      GoTo normalexit
      End Sub

    Viewing 0 reply threads
    Reply To: PowerPoint 2003 macro error

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: