Home > Software design >  Why am I getting VBA 'Run-time error 70: Permission Denied' when using ExportAsFixedFormat
Why am I getting VBA 'Run-time error 70: Permission Denied' when using ExportAsFixedFormat

Time:10-07

The following code works perfectly in Microsoft 365 PowerPoint version 2007

Sub testSavePDF()
    ActivePresentation.ExportAsFixedFormat "testExportPDF.pdf", _
    FixedFormatType:=ppFixedFormatTypePDF
End Sub

In Microsoft 365 MSO (Version 2209 Build 16.0.15629.20152) 64-bit I get a runtime error 70 - Permission Denied. I have not found anything specifically related to this on MS site other than this article by Chris Dietsch.

I have tried adding 'KeepIRMSettings:=False' and various other flags, and tried using ExportAsFixedFormat2 but get the same result. If I set

FixedFormatType:=ppFixedFormatTypeXPS

I do not get the error and it writes the XPS file successfully. I have verified I have permission to write to the directory and at this point I am stumped.

Update: I reverted MS 365 2209 to Microsoft 365 MSO (Version 2208 Build 16.0.15601.20148) 64-bit and the export to PDF works again.

CodePudding user response:

I have same problem , my code was working perfect for more than 3 years every day without change , yesterday I have restart my PC (without any update) and suddenly I start getting this error (runtime error 70 - Permission Denied) , I searched a lot and found work around solution to save ppt as pdf using VBA , but I couldn't find the reason why old code stop working

below is the work around code

ActivePresentation.SaveAs "C:\testExportPDF.pdf",ppSaveAsPDF

CodePudding user response:

We had this issue yesterday with our add-in too but now appears to be fixed. I have 2209 (Build 15629.20156). We think it was impacting the Adobe Acrobat Office Add-in and so MS have fixed it quickly.

  • Related