Share via

Powerpoint VBA locking/unlocking

Anonymous
2024-02-09T17:07:01+00:00

Hello!

I'm trying specifically to use VBA to lock/unlock certain shapes in powerpoint, yet I keep getting a popup that says:
"Run-time error '438':
Object doesn't support this property or method"

I tried following this thread:

And this list of Shape methods does not include .Locked on it.

This is the line of code that's giving me issues:

mySlide.Shapes("test").Locked = True

where "test" is the name of the desired shape in the slide. I can run any other method using this code and it works just fine. Any help would be appreciated!

Microsoft 365 and Office | PowerPoint | For home | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

8 answers

Sort by: Most helpful
  1. Jim G 134K Reputation points MVP Volunteer Moderator
    2024-02-14T02:15:03+00:00

    I have a subscription for Office Windows and Office Mac.

    I think the code ought to run the same on both platforms, so to me it's a bug on the Mac side. Point taken, we don't know what version or license type of Office Mac is being asked about, but it just doesn't work at all AFAIK.

    Was this answer helpful?

    0 comments No comments
  2. Steve Rindsberg 99,166 Reputation points MVP Volunteer Moderator
    2024-02-12T18:34:20+00:00

    Yes, but WHICH PPT for Windows. IIRC, it works in M365/subscription version but not in the non-sub version (ie, 2021)

    Was this answer helpful?

    0 comments No comments
  3. Jim G 134K Reputation points MVP Volunteer Moderator
    2024-02-11T18:51:37+00:00

    Hi Steve,

    This works in PPT for Windows for me, but not Mac

    Sub test()
    Dim myDocument
    Set myDocument = ActivePresentation.Slides(1)
    myDocument.Shapes("Rectangle 3").Locked = True
    End Sub
    

    Was this answer helpful?

    0 comments No comments
  4. Steve Rindsberg 99,166 Reputation points MVP Volunteer Moderator
    2024-02-11T15:12:22+00:00

    Bug or just not yet implemented ...?

    It doesn't work in Windows/PPT2021 either.

    Was this answer helpful?

    0 comments No comments
  5. Jim G 134K Reputation points MVP Volunteer Moderator
    2024-02-09T18:18:41+00:00

    Hi

    I confirm this is a bug.

    Use the Menu Bar and choose Help > Feedback > I Don't Like Something to alert Microsoft to this problem.

    Thanks

    Was this answer helpful?

    0 comments No comments