#1
|
|||
|
|||
PowerPoint VBA: ApplyTemplate & absolute path
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 |
#2
|
|||
|
|||
How would the template file be found if you didn't specify the path?
Anyway you have to! You can also try oPowerPoint.Presentations.Open Filename:="C\Users\Tin\Desktop\test.potm", Untitled:=True |
#3
|
|||
|
|||
Quote:
I just thought my file that has the codes is on the same directory with the template file. I thought I'd use relative paths for reference. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro for absolute text box re-position | hobbsbaboo | PowerPoint | 0 | 03-15-2012 01:44 AM |
PowerPoint Motion Path | Triaba | PowerPoint | 1 | 12-19-2011 12:47 AM |
How do I align image at ABSOLUTE top left of a table cell? | shnoozin | Outlook | 0 | 07-22-2011 03:30 PM |
How To Get Image to be absolute center of slide | mjg060468 | PowerPoint | 3 | 08-09-2010 02:07 PM |
truncating path or renaming audio file to play in powerpoint | rbookend | PowerPoint | 0 | 05-02-2006 03:39 PM |