Share via

Visual Basic errors in Powerpoint

Anonymous
2019-05-23T18:59:51+00:00

I am using a Macro I found (on a tutorial - I found 2 different ones that I tried and both failed) to change the FPS when I export the presentation into a movie file format "mov"/"mp4". When I run the Macro, an error window pops with the following message: Microsoft Visual Basic Compile error: Method or data member not found When the message pops up, it highlights ".CreateVideoStatus".

Then, after I close the error message, a yellow arrow pops up next to the top line that says "Sub PowerPointVideo()" I am having the worst time trying to figure out what the issue is. Please help!

Sub PowerPointVideo()

If ActivePresentation.CreateVideoStatus <> ppMediaTaskStatusInProgress Then

ActivePresentation.CreateVideo FileName:=Environ(“USERPROFILE”) & “\Dekstop\MyPowerpointVideo.mp4”, _

UseTimingsAndNarrations:=True, _

VertResolution:=2160, _

FramesPerSecond:=120, _

Quality:=100

Else: MsgBox "There is another conversion to video in progress"

End If

End Sub

Microsoft 365 and Office | PowerPoint | For home | Windows

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

Answer accepted by question author

Anonymous
2019-05-23T22:53:29+00:00

Which version of PowerPoint are you using? CreateVideo is not available on the Mac version.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

John Korchok 232.4K Reputation points Volunteer Moderator
2019-05-23T19:40:41+00:00

Environ("USERPROFILE") is Windows-only, which is why the macro can't find the file. You're also using Windows-style path separators () instead of Mac (/)

Ron de Bruin has a web site with many tips for working with VBA under macOS. Here's his page on finding special folders using AppleScript. Though his focus is Excel, a lot of VBA information applies to Word and PowerPoint as well.

If this macro is to run on Windows as well as Mac, then learning to use conditional compilation is a must: Test if it is a Mac or a Windows Machine  Differentiate between Office for Mac versions at compile time You can use conditional compilation to create a PathSeparator constant in PowerPoint that works like the command found in Word VBA. Then you don't have to worry which way the slash slants.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2019-05-23T23:13:09+00:00

    Microsoft PowerPoint for Mac Version 16.25; Office 365 Subscription

    Was this answer helpful?

    0 comments No comments