我試圖將一系列Excel表格轉換爲PowerPoint,並在Office 2013中成功爲此創建了一個宏,但我試圖將其應用於Office 2010.將Excel表格複製到PowerPoint中的最佳方法(2010)?
問題是將表格粘貼到PowerPoint時, Office 2010似乎需要唯一/不同的代碼。
我原本:
'Copying Tables to PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
For i = 0 To Table3
Sheets("Charts").Range(ChartStart, ChartEnd).Offset(i * Row2, 0).Copy
Set PPSlide = PPPres.Slides(1)
Set PPShape = PPSlide.Shapes.Paste
PPShape.Name = "Table" & i
但此後被告知修復2010年的版本是使用.PasteSpecial所以我有:
'Copying Tables to PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
For i = 0 To Table3
Sheets("Charts").Range(ChartStart, ChartEnd).Offset(i * Row2, 0).Copy
Set PPSlide = PPPres.Slides(1)
Set PPShape = PPSlide.Shapes.PasteSpecial(dataType:=10)
PPShape.Name = "Table" & i
事情是使用數據類型:= 10手看跌圖表轉換成PowerPoint格式不正確,適合我的目的。我需要使用ppPasteHTML將表格作爲表格使用ppPasteHTML,但是,當我嘗試將此輸入到PasteSpecial函數時,我收到一條錯誤代碼,指出剪貼板是空的。
有誰知道「ppPasteHTML」有一個數字相當於在PasteSpecial的數據類型的選擇嗎?還是另一種方式來獲得一個Excel表格到PowerPoint作爲辦公室表2010?
謝謝!
可能出現[在Excel 2010中Excel複製表格從Excel複製到PowerPoint中,但不是Excel 2013?](http:// stackoverflow。問題/ 25556397 /麻煩複製表從excel到powerpoint-with-vba-in-excel-2010-but-not-ex) – 2014-08-29 00:03:27
你真的**不應該問同樣的問題一天兩次... – 2014-08-29 00:03:42
我已經關閉了另一個,因爲它沒有任何答案。你繼續這一個 – 2014-08-29 04:36:13