Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I created a macro in Office 2003 using early binding to copy data from Excel
into Powerpoint...not the greatest code...but it works! Now my users are switching to Office 2007 and the code won't run! I have include 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)).S elect ' Reference active presentation Set PPPres = PPApp.ActivePresentation PPApp.ActiveWindow.ViewType = ppViewSlide ' Reference active slide Set PPSlide = PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRa nge.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" 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Check if the cells in the workbook are selected to see if the problem si in excel or powerpoint. I wouldmake the following change from 'EXCEL CODE Sheets("TablesforPP").Select range("a2").Select Selection.Copy to with Thisworkbook 'EXCEL CODE Sheets("TablesforPP").range("a2").Copy end with -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170126 Microsoft Office Help |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "joel" wrote: Check if the cells in the workbook are selected to see if the problem si in excel or powerpoint. I wouldmake the following change from 'EXCEL CODE Sheets("TablesforPP").Select range("a2").Select Selection.Copy to with Thisworkbook 'EXCEL CODE .Sheets("TablesforPP").range("a2").Copy end with -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170126 Microsoft Office Help . Sorry....yes I should have stated that the cell in Excel IS selected. The problem is in the paste to Powerpoint. Nicki |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If you manually went into the clip board will the object paste into Power Point? Can you manually copy the object from Excel into Power Point. I'm thinking you may need to paste using Pastespecial instead of Paste. Try manualy copying ans and pasting using Pastespecial and find out which Pastespecial options gives you the results you are looking for. -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170126 Microsoft Office Help |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() No...that's not it. I can manually paste...and can paste special. I'm thinking it's something to do with the code and how Powerpoint is treating the "shape". Not sure what the code is to "pastespecial" in powerpoint. My "shape" looks more like I would expect when I paste special in "Formatted Text (RTF)" but I'm not sure of the Powerpoint code to perform this, and the macro recorder in 2003 doesn't help (there is no macro recorder in Powerpoint 2007!). Maybe if I search/post over on the Powerpoint site I might get some insight? Nicki |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() There are a few ways of getting the VBA commands for Power Point 1) Look at the help at Power Point 2) The method are different in power point than excel. To get the Power Point Library you should add the reference into Excel VBA by using VBA menu menu : Tools - Reference - Microsoft Power Point xx.x object Library 3) You can record a macro in Power Point and copy text from one slide in Power Point to another slide. the adapt the Power Point code into your excel macro. 4) You don't necessarily need to add the reference library to excel as long as the Property values are call out by numbers instead of the Constants defined in the library. You can open the Object Browser in both excel and Point Point VBA. It is under View or just right click the module sheet in VBA. At the Top of the Object browser is a binocular Icon and a box to the left. If you put into the box to the right of the Icon (in excel) and type xlpastevalue you will se the value -4163 and all the other options for excel PasteSpecial. No if you add the reference to excel for power point you will also find ppastedatatype for the power point property values. If you don't have the power point reference specified excel will use excel pastespecial default value into power point and you may not get the correct results. Power point except value 1 to 11. So the exceptable values in excel doesn't match the acceptable values in power point. I haven't checked if this is true with a regular paste. -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170126 Microsoft Office Help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Installing a Vista Office 2007 developed XLA to XP office 2003 machine | Excel Programming | |||
Office 2007 compatibility pack on Office 2003 (slow network file | Setting up and Configuration of Excel | |||
Opening an Office 2007 Excel file in Office 2003 | Excel Discussion (Misc queries) | |||
Problem with Interop.Excel after uninstalling Office 2007 and installing Office 2003 | Excel Programming |