0
我有一些VBA可以成功地從Excel複製單元格數據並粘貼到給定模板的給定PowerPoint幻燈片中。使用VBA將具有可編輯單元格的表格粘貼到使用VBA的Excel中Powerpoint
但是,對於粘貼的對象,我無法根據需要選擇單個單元格和格式。我假設這是與粘貼類型的工作方式有關 - 我需要將其更改爲VBA代碼中的粘貼,以便粘貼,以便操作單元格的內容?
如果我手動複製Excel中的一些單元格,然後手動粘貼特殊的「保持源格式化(K)」一次,我得到一個可編輯的表格,我可以更改單元格間距,插入新的行等,如果我可以做它手動,當然可以使用VBA完成?
這裏是我的代碼,不會糊:
'Opens a PowerPoint Document from Excel
Dim PPapp As PowerPoint.Application, PPpres As PowerPoint.Presentation, PPslide As PowerPoint.Slide
Dim XLws As Worksheet
Set XLws = ActiveSheet
Set PPapp = New PowerPoint.Application
Set PPpres = PPapp.Presentations.Open("C:\Users\Colin\Dropbox (Edge45)\Edge45 Team Folder\Edge45 Company Documents\Templates\Powerpoint Templates\Edge45 Audit Template Macro.potm", Untitled:=msoTrue)
PPapp.Visible = True
Set PPslide = PPpres.Slides(2)
XLws.Range("A1:D16").Copy
PPslide.Shapes.PasteSpecial DataType:=ppPasteOLEObject, Link:=msoFalse
Application.CutCopyMode = False
多數民衆贊成 - 輝煌 - 謝謝。快速的問題,我如何使用VBA在Powerpoint中安排表的位置和大小? – Superhans
查看http://stackoverflow.com/questions/20753305/setting-an-objects-position-in-powerpoint-using-vba – CLR