PowerPoint VBA code for Mac

Anonymous
2020-07-07T21:48:25+00:00

What is the proper PowerPoint VBA code to save a file as .pptx on the Mac. I have a file containing macro code but want to save it as a .pptx without the code and I don't want to be prompted with a warning about this.

What I'm doing was working when I was using Windows 10, but now I'm using a Mac and it's not quite working correctly.

Thank you!

Bruce

[Move from PowerPoint/ Mac/Microsoft 365 Apps or Office 365 for business]

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

Steve Rindsberg 99,171 Reputation points MVP Volunteer Moderator
2020-07-12T15:35:28+00:00

I'd start by changing the FileName:= parameter to the full path to the folder\filename where you want the file to be saved, including the desired extension.

Ie, something like FileName:=sPath & sName & ".PPTX"

Make sure that sPath ends with the correct path separator for Mac and that it has a legitimate value ... in your code example, it doesn't.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-07-12T01:56:12+00:00

    I begin with a blank slide saved as a .pptm file with the code that I use. The code imports several smaller .pptx files into the .pptm file. Once all are combined, I want to save the file under another name as a .pptx file with no macro code. Below is the sub that does the saving:

    Private Sub cbSaveSlides_Click()

     Dim sDate As String

     Dim sName As String

     sDate = CStr(Date)

     sDate = Replace(sDate, "/", "-")

     ChDir (sPath)

     sName = "Slides for " & sDate

     With Application.ActivePresentation

       .SaveAs _

            FileName:=sName, _

            FileFormat:=ppSaveAsOpenXMLPresentation

     End With

     Unload Me

     ActivePresentation.Application.Activate

    End Sub

    When I run this code, the upper part of the PowerPoint slide window shows the new name and it says "Saved to MyMac". However, there is no file to be found. When I do a "save as" to save it as a .pptx file, I get the message about losing the macros, which is as it should. In Windows, I was able to save the file as a .pptx without having Windows give me a warning.

    Thank you!

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Steve Rindsberg 99,171 Reputation points MVP Volunteer Moderator
    2020-07-08T15:27:29+00:00

    I'd start by showing us the code you're using (simplified to its most basic form).

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. John Korchok 234.7K Reputation points Volunteer Moderator
    2020-07-09T01:03:20+00:00

    PowerPoint for Mac 2016/2019 VBA is incomplete, so many macros that will run under Windows will not on a Mac. But if you post your code or a snippet of the save routine, we'll take a look.

    Was this answer helpful?

    0 comments No comments