通過shell打開一個ppt,怎么用變數代替這么ppt,然后我可以對這ppt進行編輯
uj5u.com熱心網友回復:
不應該用shell打開,應該這樣寫:
Sub test()
Dim pptApp As New PowerPoint.Application
Dim MyPresentation As Presentation
Set MyPresentation = pptApp.Presentations.Open("d:\asd.pptx")
MyPresentation.Slides(1).Shapes.AddTextbox 1, 40, 160, 650, 50 ' 添加一個文本框
' ...
End Sub
uj5u.com熱心網友回復:
set那一句有問題,說PowerPointframe window dose not exist
uj5u.com熱心網友回復:
運行錯誤-2147188160(80048240)
uj5u.com熱心網友回復:
看你的截圖,是在excel里面用VBA想啟動PPT。那么你需要先參考powerpoint
選單-工具-參考
彈出表單里面找到你的powerpoint,勾起來。然后再用米老鼠的這段代碼就行了。

uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
PPT 列印當前頁的宏怎么做啊?大神幫忙啊uj5u.com熱心網友回復:
參考沒問題,就是想編輯ppt,以后出報告方便,一樓的例子可以用,就是我的電腦不知道怎么回事,要把ppt打開,才能運行那個程式uj5u.com熱心網友回復:
Sub test()
Dim pptApp As New PowerPoint.Application
pptApp.visible = true ' 加一句這個,試試?
Dim MyPresentation As Presentation
Set MyPresentation = pptApp.Presentations.Open("d:\asd.pptx")
MyPresentation.Slides(1).Shapes.AddTextbox 1, 40, 160, 650, 50 ' 添加一個文本框
' ...
End Sub
uj5u.com熱心網友回復:
perfect。。。。。。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/31899.html
標籤:VBA
下一篇:資料庫連接的DBHelper類,代碼插入中文后在資料庫中顯示問號,知道要加charset=utf8,但是,,,我不知道加哪
