Using VBA to paste linked Excel range into Powerpoint 
Author Message
 Using VBA to paste linked Excel range into Powerpoint

Hi -

looked through the archive but couldn't find the answer to this one:

I have an Excel workbook with 50 sheets in them. Every sheet has a
range with the same name. Currently, the marco I wrote goes through
all the sheets, grabs the range and then pastes the range into
PowerPoint with the following command:

Sheets(SheetName).Range("RangeName").CopyPicture xlScreen, xlPicture

This of course only allows for a picture to be placed into the
presentation. How do I have to modify this command so that I am
actually getting the information linked to the workbook. Meaning, I
want to past the information into my presentation so that everytime
updates to the Excel file are done, my presentation changes as well.

Thanks so much in advance,

Cade



Wed, 08 Sep 2004 05:17:41 GMT  
 Using VBA to paste linked Excel range into Powerpoint
In Excel, use Range("myRng").Copy.

In PP, use ActiveWindow.View.PasteSpecial ppPasteDefault, link:=msoTrue

You may have to adapt the syntax to your specific needs and OLE
configuration.

[Above code fragments tested with Office XP]

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Microsoft MVP -- Excel
--


Quote:
> Hi -

> looked through the archive but couldn't find the answer to this one:

> I have an Excel workbook with 50 sheets in them. Every sheet has a
> range with the same name. Currently, the marco I wrote goes through
> all the sheets, grabs the range and then pastes the range into
> PowerPoint with the following command:

> Sheets(SheetName).Range("RangeName").CopyPicture xlScreen, xlPicture

> This of course only allows for a picture to be placed into the
> presentation. How do I have to modify this command so that I am
> actually getting the information linked to the workbook. Meaning, I
> want to past the information into my presentation so that everytime
> updates to the Excel file are done, my presentation changes as well.

> Thanks so much in advance,

> Cade



Thu, 09 Sep 2004 03:31:01 GMT  
 Using VBA to paste linked Excel range into Powerpoint
Tushar's posted code will only work in PPT 2002. There is no
PasteSpecial method in PPT 97/2002.

The workaround for that is to copy the chartsheet to a new workbook in
Excel which automatically creates the link to the original source data
range. Then copy and paste that chartsheet into PPT using regular copy
and paste.

Then when the underlying Excel data changes you only have to activate
the OLE object (the chart object in PPT) to force the link to update.
This can all be done with VBA.

Brian Reilly, PowerPoint MVP



Thu, 16 Sep 2004 22:34:53 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Pasting an Excel range as a picture using VBA

2. Office 97 Excel to Powerpoint paste vs paste link

3. Link Excel chart in Powerpoint using VBA

4. Excel to PowerPoint paste link as microsoft excel worksheet object

5. Paste an Excel range in a specified slide into Powerpoint

6. Using VBA to select a highlighted range and paste values to another workbook

7. Pasting Excel Link works, Pasting Excel Object doesn't

8. Paste Linking Ranges From Excel

9. Pasting Range from Excel 2002 via VBA to Word causes a New Workbook to open

10. How to paste a Excel.Chart to Powerpoint.Slides.Shape with VBA


 
Powered by phpBB® Forum Software © phpBB Group