我目前正在尝试执行以下步骤:
为此,我将 PP-Template 作为 OLEO-Object(通过 Insert-->Object-->Choose PPTX)嵌入到名为“PP Export”的工作表上,名为“PPtemplate”并运行以下代码:< /p>
'Dim oEmbFile As Object
'Application.DisplayAlerts = False
'Set oEmbFile = ThisWorkbook.Sheets("PP Export").OLEObjects("PPtemplate")
'oEmbFile.Verb Verb:=xlOpen
'Set oEmbFile = Nothing
'Set PPpres = PPapp.ActivePresentation
'Application.DisplayAlerts = True
这很好用,但我只能这样做一次。这是因为一旦第一个宏编辑模板,它会自动保存这些更改,模板不再是模板而是第一次宏运行(编辑模板)的结果...
我怎样才能阻止它覆盖自己?也许以某种方式将模板提取到用户 PC 然后打开并编辑它,因此即使在运行宏之后嵌入的模板也始终相同?
任何帮助/提示将不胜感激! 感谢并保持健康
编辑 - 解决方案:
With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
.Show
PPdateipfad = .SelectedItems.Item(1)
End With
Dim oEmbFile As Object
Application.DisplayAlerts = False
Set oEmbFile = ThisWorkbook.Sheets("PP Export").OLEObjects("PPvorlage")
oEmbFile.Verb Verb:=xlOpen
Set oEmbFile = Nothing
Set PPpres = PPapp.ActivePresentation
Application.DisplayAlerts = True
PPpres.SaveAs (PPdateipfad + "\QM-Check Präsentation.pptx")
PPpres.Close
Set PPpres = PPapp.Presentations.Open(PPdateipfad + "\QM-Check Präsentation.pptx")
答案 0 :(得分:0)
解决方案:
With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
.Show
PPdateipfad = .SelectedItems.Item(1)
End With
Dim oEmbFile As Object
Application.DisplayAlerts = False
Set oEmbFile = ThisWorkbook.Sheets("PP Export").OLEObjects("PPvorlage")
oEmbFile.Verb Verb:=xlOpen
Set oEmbFile = Nothing
Set PPpres = PPapp.ActivePresentation
Application.DisplayAlerts = True
PPpres.SaveAs (PPdateipfad + "\QM-Check Präsentation.pptx")
PPpres.Close
Set PPpres = PPapp.Presentations.Open(PPdateipfad + "\QM-Check Präsentation.pptx")