Code:
''' in Excel
Sub GenerateQuizSlides()
Dim oPowerPoint As Object, oPresentation As Object
Set oPowerPoint = CreateObject("PowerPoint.Application")
oPowerPoint.Visible = True
Set oPresentation = oPowerPoint.Presentations.Add(WithWindow:=msoTrue)
'' error
'' Run-time error '-2147188160 (80048240)':
'' Automation error
oPresentation.ApplyTemplate Filename:="test.potm"
''
'' no error
''oPresentation.ApplyTemplate Filename:="C:\Users\Tin\Desktop\test.potm"
''
oPresentation.Close
oPowerPoint.Quit
Set oPresentation = Nothing
Set oPowerPoint = Nothing
End Sub
Why does ApplyTemplate need absolute paths of files?