Hello,
I need some help copying and pasting data from Excel to PowerPoint via VBA. I have a range of data that I want to copy from Excel and Paste this range to PowerPoint. The data range is essentially a table of data with formatting.
The problem that I am running into is that I want the data pasted into PowerPoint to be the same format that it was copied. I need to be able to make modifications to the data once it is in PowerPoint. I can get exactly what I want when I do this manually (select data range in Excel, copy it, select the powerpoint slide, then select Paste Special -> HTML). I cannot seem to do this with VBA though. So in short Im trying to Paste Special -> HTML in PowerPoint but it isnt working.
This is the main code that I have so far;
Set PPSlide = PPApp.ActivePresentation.Slides.Add(1, ppLayoutBlank)
Worksheets(SheetName).Range(RangeName1).Copy
PPSlide.Shapes.PasteSpecial (ppPasteHTML)
But I always get a runtime error when it gets to the ppPasteHTML part. I am running Office 2010 but I would also like to be able to run this macro on older versions of Office.
Any help is greatly appreciated.
Nick
I need some help copying and pasting data from Excel to PowerPoint via VBA. I have a range of data that I want to copy from Excel and Paste this range to PowerPoint. The data range is essentially a table of data with formatting.
The problem that I am running into is that I want the data pasted into PowerPoint to be the same format that it was copied. I need to be able to make modifications to the data once it is in PowerPoint. I can get exactly what I want when I do this manually (select data range in Excel, copy it, select the powerpoint slide, then select Paste Special -> HTML). I cannot seem to do this with VBA though. So in short Im trying to Paste Special -> HTML in PowerPoint but it isnt working.
This is the main code that I have so far;
Set PPSlide = PPApp.ActivePresentation.Slides.Add(1, ppLayoutBlank)
Worksheets(SheetName).Range(RangeName1).Copy
PPSlide.Shapes.PasteSpecial (ppPasteHTML)
But I always get a runtime error when it gets to the ppPasteHTML part. I am running Office 2010 but I would also like to be able to run this macro on older versions of Office.
Any help is greatly appreciated.
Nick