VBA not opening PPT in MAC OS

Akbarov

Active Member
Joined
Jun 30, 2018
Messages
347
Office Version
  1. 365
Platform
  1. Windows
Hello,

I use following code in Windows, works perfectly fine. But when I try to run this code in MAC OS , I get error on this line:

VBA Code:
Set pPres = pptApp.Presentations.Open(currentPath & Application.PathSeparator & pptname, msoFalse, msoCTrue, msoCTrue)

Code:
Dim pptApp As Object


Dim pPres As Object
Dim xl As Excel.Workbooks


Dim ws As Worksheet
Dim sldrange As Object
Dim sld As Object
Dim pattrenSlide As Object

Dim WorkSheetRange As Range

Sub Export()
'both file names and path
Dim wkname, pptname, currentPath As String


'Other Values

pptname = "Template.pptx"
currentPath = ThisWorkbook.Path


'Ópening Powerpoint
Set ppApp = CreateObject("Powerpoint.Application")
Set pPres = ppApp.Presentations.Open(currentPath & Application.PathSeparator & pptname, msoFalse, msoCTrue, msoCTrue)
'Opening Excel
Set wk = ThisWorkbook
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
error: Method "Open" of object "Presentation" failed
 
Upvote 0
Are you sure the template presentation is in the same folder?
 
Upvote 0
I can't replicate the problem. Depending on where the workbook is, I get a prompt to allow access to the folder (Apple's sandboxing) or the template opens. Is it a local folder, or a cloud-based folder?
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,826
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top