N
Nickis
I did post this on the Excel Programming site, but not really a lot of
insight came back, so I'm hoping a Powerpoint expert can help!
I created a macro in Office 2003 using early binding to copy data from Excel
into Powerpoint...not the greatest code...but it worked! Now my users are
switching to Office 2007 and the code won't run! I have include what I
believe to be the relevant string of code below.
Dim objPPT As Object
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Set PPApp = GetObject(, "Powerpoint.Application")
PPApp.ActivePresentation.Slides.range(Array(13)).Select
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
' Reference active slide
Set PPSlide =
PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
'EXCEL CODE
Sheets("TablesforPP").Select
range("a2").Select
Selection.Copy
'POWERPOINT CODE
PPSlide.Shapes.Paste.Select
This is where it errors with the following message:
"Run-time error '-2147188160(80048240)':
Shapes (unknown member): Invalid request. Clipboard is empty or contains
data which may not be pasted here"
The data is captured by the Excel and is in the clipboard ready to paste,
and I can manually paste. By looking at how the data appears when I manually
paste I think maybe I need to "paste special" as RTF, but I'm not sure of the
coding for that. I'm not a developer, and had enough trouble getting this
all set up in 2003, now having to "convert" to 2007 is extremely frustrating!
I don't need this coding to be compatible with both Office 2003 and 2007, I
just need it to work in Office 2007. I'm sure I will run into more issues as
I cycle through the code, but if I can understand why this is happening and
fix it, I think I'll be a long way to understanding any subsequent issues.
Thanks,
Nicki
insight came back, so I'm hoping a Powerpoint expert can help!
I created a macro in Office 2003 using early binding to copy data from Excel
into Powerpoint...not the greatest code...but it worked! Now my users are
switching to Office 2007 and the code won't run! I have include what I
believe to be the relevant string of code below.
Dim objPPT As Object
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Set PPApp = GetObject(, "Powerpoint.Application")
PPApp.ActivePresentation.Slides.range(Array(13)).Select
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
' Reference active slide
Set PPSlide =
PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
'EXCEL CODE
Sheets("TablesforPP").Select
range("a2").Select
Selection.Copy
'POWERPOINT CODE
PPSlide.Shapes.Paste.Select
This is where it errors with the following message:
"Run-time error '-2147188160(80048240)':
Shapes (unknown member): Invalid request. Clipboard is empty or contains
data which may not be pasted here"
The data is captured by the Excel and is in the clipboard ready to paste,
and I can manually paste. By looking at how the data appears when I manually
paste I think maybe I need to "paste special" as RTF, but I'm not sure of the
coding for that. I'm not a developer, and had enough trouble getting this
all set up in 2003, now having to "convert" to 2007 is extremely frustrating!
I don't need this coding to be compatible with both Office 2003 and 2007, I
just need it to work in Office 2007. I'm sure I will run into more issues as
I cycle through the code, but if I can understand why this is happening and
fix it, I think I'll be a long way to understanding any subsequent issues.
Thanks,
Nicki