Office 2003 macro won't run in Office 2007

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

0
Utf
1/15/2010 6:52:04 PM
powerpoint 2011 articles. 0 followers. Follow

3 Replies
1842 Views

Similar Articles

[PageSpeed] 52

In article <671175EE-5FB1-4ECC-9082-6DFA6BE32A87@microsoft.com>, Nickis wrote:
> 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"

This seems to be a fairly common problem when pasting from Excel, at least with 
the original release of PPT2007.  Have you applied SP2?  If not, I'd do that and 
try again.

You can also clean up the code a good bit:

Instead of this:
> PPApp.ActivePresentation.Slides.range(Array(13)).Select
Do this:

Set PPSlide = ActivePresentation.Slides(13)

And if you do that, you don't need any of this:

>     ' Reference active presentation
> Set PPPres = PPApp.ActivePresentation
> PPApp.ActiveWindow.ViewType = ppViewSlide
>     ' Reference active slide
> Set PPSlide = 
> PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)

Just this:

PPSlide.Shapes.Paste.Select

And actually, you probably don't need the .Select 


> 
> 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


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


0
Steve
1/15/2010 10:09:47 PM
Does this work?

Sub myPaste()
'Early Bound
'Assumes Presentation is Open and reference set to PowerPoint
Dim PPApp As PowerPoint.Application

Set PPApp = GetObject(Class:="Powerpoint.Application")

PPApp.ActiveWindow.ViewType = ppViewSlide
PPApp.ActivePresentation.slides(13).Select
'EXCEL CODE
Sheets("Tables").Select
Range("a2").Select
Selection.Copy

'POWERPOINT CODE
PPApp.ActiveWindow.View.PasteSpecial (ppPasteRTF)
End Sub
-- 
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html






"Nickis" wrote:

> 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
> 
0
Utf
1/16/2010 11:05:05 AM
It took me a while to get back to this as I was so disheartened.  I checked 
and I do already have SP2. 

John,
Thanks so much, this does work!  The placing of this item I'm pasting with 
the macro and other items I'm pasting later in the code are all off, but 
that's a small thing to fix.  I really appreciate your help!

Nicki

"John Wilson" wrote:

> Does this work?
> 
> Sub myPaste()
> 'Early Bound
> 'Assumes Presentation is Open and reference set to PowerPoint
> Dim PPApp As PowerPoint.Application
> 
> Set PPApp = GetObject(Class:="Powerpoint.Application")
> 
> PPApp.ActiveWindow.ViewType = ppViewSlide
> PPApp.ActivePresentation.slides(13).Select
> 'EXCEL CODE
> Sheets("Tables").Select
> Range("a2").Select
> Selection.Copy
> 
> 'POWERPOINT CODE
> PPApp.ActiveWindow.View.PasteSpecial (ppPasteRTF)
> End Sub
> -- 
> john ATSIGN PPTAlchemy.co.uk
> 
> Free PPT Hints, Tips and Tutorials
> http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
> 
> 
> 
> 
> 
> 
> "Nickis" wrote:
> 
> > 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
> > 
0
Utf
1/19/2010 2:30:01 AM
Reply:

Similar Artilces:

Problems printing in Publisher 2003 with HP PSC 2410 #2
I am new to publisher 2003 and am having great difficulties printing anything properly using an HP PSC 2410 all in one. As an example when trying to print a half page side folded pre-designed greetings card all that prints is page 1 and part of page 4, minus any text. Pages 2 and 3 are missing altogether. The print preview however displays everything correctly. I have reinstalled Office 2003 and updated the printer drivers to the latest versions but the problem remains. Any help is much appreciated. ...

Printing problem from Excel 2007
Greetings, I am having an issue with printing from Excel 2007. Many users when printing from Excel with get several pages of non-sensical "junk" printed out on the pages. If it actually prints what is on the page, none of the items are in the cells, but look like they are just randomly thrown about the page. I have found that this most often is related to the Calibri font somehow, because I instruct them to change the font to Arial and all prints fine. That being said, if the user converts the Excel sheet into a PDF and print, it prints perfect. This is a great workaround, but kind ...

Excel 2007 Need to permanently change Normal settings for gridlines
I am using Excel 2007 for the first time and find the gridlines delineating the cells are so faint as to be nearly indistinguishable. I can go into the cell formatting and modify the normal style, and it is just the way I want it. But I can't find a way to make Excel remember this and treat it as the new definition of the Normal style. I don't want to have to redefine Normal every time I open a new spreadsheet. Someone please help! Regards Leonard Priestley The changes you describe are changing the Border color and NOT gridlines. Go into Excel Options and cl...

switching from office prof. 2007 trial version to 6 month prepaid
CAN I CONVERT MY DOWNLOADED TRIAL VERSION OF OFFICE PROFESSIONAL 2007 INTO 6 MONTH PREPAID SUBSCRIPTION Lose the caps and no, not in the US. Consult Microsoft in your locale to see if they offer a subscription options. -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. ALWAYS post your Outlook version. How to ask a question: http://support.microsoft.com/KB/555375 After furious head scratching, YOGESH CHITALE asked: | CAN I CONVERT MY DOWNLOADED TRIAL VERSION OF OFFICE PROFESSIONAL 2007 | INTO 6 MONTH PREPAID SUBSCRIPTION ...

InPlace ugrade from Exchange 2000 to 2003 recovery question
Hi, Will shortly be doing an inplace upgrade from Exchange 2000 enterprise edition to Exchange 2003 Enterprise edition. After we do all the steps ie. Forestprep/domainprep etc then do the actual upgrade if the upgrade fails how do we roll back. We use Brightstor Arcserve version 11 which is supported by Exchange 2000 and we backup doing the Full method not bricks level. I have documentation on how to restore Exchange using this but this just restores the database to my knowledge (never had to do it) with exchange 2000 so how do I roll back a failed upgrade. We have to do an inplace...

exchange 2003
I just set up a mail server at things are working fine in the network where it resides. The issue is that I have 5 other buildings that are connected via a VPN, and they can not connect. Do I need to change settings at their locations? DNS?? WINNS??? It depends on type of client, but generally proper DNS setup is required. Also make sure that no firewalls interfere. laker18 wrote: > I just set up a mail server at things are working fine in > the network where it resides. The issue is that I have 5 > other buildings that are connected via a VPN, and they > can not co...

Exchange 2003 SP1 Install Error
When I try to install E2003 SP1 I get the error: EventType exchangesetuperror, P1 6_5_7226_0, P2 update, P3 microsoft exchange messaging and collaboration services, P4 install, P5 e0070101, P6 _null_, P7 1, P8 NIL, P9 NIL, P10 NI The log says it cannot find a file but I can't tell which file it's looking for. Any ideas how to fix this? Thanks ...

Macros #50
How do I move macros from one computer to another? In the VBA editor, right click on the sheet name or module name (in the left panel)that contains the macro and click on "Export File" -- Regards, Dave "Neal" wrote: > How do I move macros from one computer to another? Macros are always stored in workbooks, so you can simply copy the workbook containing the macros from one machine to another. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Neal" <Neal@discussions.microsoft.com> wrote in mess...

Macro help #12
Hi, I am working on a macro in Excel 2003 Pro, and everytime I go to sort a column of data. There are about 10 rows of data in about 200+ columns. I can only get the macro to sort the column that I edited it with. How can I create the macro, so each time I click on the first row of each column, click the macro button I will assign to the toolbar, then that row will be sorted, and do this for each column? Any help at all would be greatly appreciated, Jeff Garrett (user_jeff@hotmail.com) Hi Jeff please post your current code and then we can suggest changes to it. Cheers JulieD "...

Message "class not registered" opening sheet with macros Excel 97
I have created a document with Macros and is password protected. I have sent it to several people who are able to use it - the one who can't is using Excel 97 SP2. They are getting error message "class not registered" - could it be the version they are using and how do I make sure they are able to use it. This could simply be a version issue if you developed on a later version and used controls from that versions object libraries. You should always use the lowest version to develop on. If this is not the case look in the VBE on the faulty machine and check tools>ref...

outlook 2003 add a dictionary
Hi, how can add a dictionary for spell checking ? in outlook 2003 su tools / options / spelling actually i have only English e French. ciao francesco ...

Outlook 2003 Newsreader
Hi, I've Outlook 2003 and I tried to use it to read newsgroups, using the customize in the menu bar and putting the option news on the go menu. It worked, but only the first time. The optino news now disapeared from the menu go, and from the customize. Where it go? I tried to repair and don't fix. Another thing is the Business Manager that I installed I think version beta, that crashes often, but I imagine that we can't have a solution on that without more info. Thanks Joao Bras To get the News command back, go back to the Programs tab in Control Panel | Internet Options and...

Office assistant error...
Hi, Having an issue on a standardised platform of XP with Office 2000 (SR2) and Outlook 2003. Users experiencing an error when starting Office Assistant - "The office assistant could not be started." The recommendation is to repair the office installation. Have attempted this as well as a reinstallation of Office 2000 and Outlook 2003, all to no avail. The error is sporadic but is occuring often enough to warrant this post! Anybody out there got some suggestions? Cheers, Darren Kukulka Systems Manager Beacon Technology ...

Print Macro #2
Trying to write a macro to print a spreadsheet where the number of rows of data varies. What's wrong with this code? Dim rng As Range Set rng = Range("A1").End(xlDown).End(xlToRight) With ActiveSheet.PageSetup .PrintArea = rng End With Thank you. Pam Hi Pam Leave your PrintArea empty Excel will print all cells with a value on the sheet -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Pam" <gasp0225@juno.com> wrote in message news:16e401c38521$a7d25420$3501280a@phx.gbl... > Trying to write a macro to ...

Access 2007 Reports
I'm using an Access 2000 mdb (split ends) in Access 2007. I cannot up- convert because other terminals don't have Office 2007. It works as a database just fine except: When I try to change a (front end) report from the default printer to another specific printer in design view, page setup, it all LOOKS good except it does not save my changes upon return and goes back to the default printer. I never had this problem with earlier versions of Access and the specific printer in questions works fine with other apps and terminals. Any ideas people? Many thanks. JM This is a known prob...

Made two versions; both run very slow . Any spare nitro around
I've been recording some macros to append together, but put the following together by writting it (well in my case it's a bitsa from all the good code on this site). However, it runs very slow. Every 3 letter code in cells down column("K") needs to be checked to see if the same is found down column("A"). As a check, I've just been putting a "1" in the same row in column("N"). Latter columns("K:N") can then be sorted on column("N"). Column("A") has 3 letter codes from row 3 to 1402 (but changes each run). Colu...

Question Regarding Excel 2007 Formatting Corruption
Hi Folks, I am having a problem with Excel 2007 files losing all formatting (merged cells, colors, borders, and data formatting (99% turns into 0.99)) when I open a file on our office server make edits and then save the new file on the server. Each sheet usually has a mix of locked and unlocked cells and I unprotect the sheet to make edits. Also, something is fundamentally changed with the file as its size doubles or triples. If I reopen the corrupted file and redo any of the formatting and try to save it none of the new formatting is retained either. Has anyone else ever experienced a pr...

IE8 can't access Microsoft Office site when all other browsers can
When trying to access the Microsoft Office page using IE8 I keep getting the "Internet Explorer cannot display the webpage" message. If I use any other browser (Firefox, Opera, Safari, Chrome) I have no problem accessing the page. This happens whether running in normal or No Add-on's mode. Despite how many people keep complaining about all the problems with IE8, neither the MVP's or Microsoft acknowledge that they exist. Asus P5E Intel E8400 Core2Duo 3.0GHz 4 GB PC2-6400 DDR2 Windows 7 Ultimate (with all the latest updates installed) NIS 2010 (all up to date)...

Start Outlook 2003 at windows startup??
Hi, I have a simple question: how do I have Outlook 2003 started automatically and minimized to system tray at windows startup? Thanks in advance edomonet@libero.it <edomonet@libero.it> wrote: > how do I have Outlook 2003 started automatically and minimized to > system tray at windows startup? Put a shortcut to it in your Startup program group. However, I don't believe it will start minimized. -- Brian Tillman It's better to put a shortcut in your Quick Launch bar or you will get errors if OL loads too soon before your connection and antivirus. You can customiz...

Clarification please on exchange 2003 with DPM Server 2010
I would like to protect an exchange 2003 setup remotely. In the event of a problem such as accidently deleted mail etc. the way to restore the database files would is to use a recovery storage group? Now does this need to be restored back over the internet to the Exchange server or can the databases be restored onto a disk taken out to the server and then loaded into the recovery storage group? I am not sure what you mean "Now does this need to be restored back over the internet to the Exchange server" but yes to restore the exchange databases you can restore the files ...

SBS 2003 migration to Server 2008 STD
Hi. We are at the limit of 75 Users and want to Migrate away from our old SBS 2003 Server to two new 2008 STD Server (one for Exchange 2010) I have looked for infos how to do that correctly but i could not find any good basis to start with. Someone already accomplished that task? I recommend Server 2008 R2 over 2008. If you use Server 2008 make sure you have SP2 or better installed before you try to install Exchange 2010. I have done it. It was fairly straightforward. That said it was not easy. There is a lot of conflicting information on the web. The basic procedure is...

Using paste in macro but with variable references.
Hi all, I am trying to use the paste function in a macro but it needs to be variable. I have split a list of data (team workloads) into the seperate teams and by days of the week. I now need the macro to compile one book with all the data in order. The headings for each team are already set on a worksheet so the data needs to be entered under each heading For example: Team A Day 1 under the heading "Team A Day 1", Team B Day 1 under the next heading on the same sheet "Team B Day 1". I hit problems as the workload ammount will alter from week to week. So of course asking...

Office 07 locking up in Win7
I have just purchased two new HP computers with Windows 7 on them. I am running office suite pro 07. Office keeps locking up after. Sometimes task mgr will restart the program, sometimes I have to power off. Either way, work is lost! I have done system restore twice but have seen no improvements. Office worked fine the first two days then 34+ updates and now it doesn't. It also locks up if monitor goes to sleep and will not recover without a power down. -- Chris & Sam "Chris&Sam" <ChrisSam@discussions.microsoft.com> wrote in message news:30...

2007 B2 MSOO has encountered a problem
More often then not when I click to open an email in my inbox I get this MSOO pop-up with a checkbox, checked telling me MSOO has encountered a problem and needs to close. Has this been an issue for others and is there a fix. If you have Adobe Acrobat Pro 6/7 (not the reader), go into Control Panel, Add/Remove Programs, click change for Adobe Acrobat Pro and remove the Office & Outlook plugins. Patrick Schmid -------------- http://pschmid.net "Jax" <Jax@discussions.microsoft.com> wrote in message news:A74147F4-CD75-4FF8-98A7-5A18B01A8FDD@microsoft.com: > More of...

E-mail Tracking 2003
I know in Outlook 2003 that e-mail recipients have the option to not send "read receipts" - can this be disabled? A lot of my users in the past have relied on getting e-mail receipts and tracking their e-mails - they are very unhappy about the recipient having an option to decline their request for receipt in Outlook 2003. Jane Jane wrote: > I know in Outlook 2003 that e-mail recipients have the > option to not send "read receipts" - can this be > disabled? A lot of my users in the past have relied on > getting e-mail receipts and tracking their e-m...