I am trying to merge nearly 40 PPTX files in the following folder: /Users/myuserid.org/Desktop/joiner
I found this code online:
Nothing seems to happen when I try to execute this macro. I feel it must be in the punctuation for where to find the files since this was written for a windows machine. Have I made the file path correctly?Sub joiner()Dim sFileTyp As String Dim sFileName As String Dim otarget As Presentation Dim i As Integer On Error GoTo errhandler sFileTyp = "*.PPT*" sFileName = Dir$(Environ("myuserid.org\Desktop\joiner\" & sFileTyp)) Set otarget = ActivePresentation Do While sFileName <> "" Call otarget.Slides.InsertFromFile(Environ("USERPROFILE") & "\Desktop\joiner\" & _ sFileName, otarget.Slides.Count) sFileName = Dir() Loop Exit Sub errhandler: MsgBox "Sorry, there was an error" End Sub



Reply With Quote