How to reference worksheet object embedded in Powerpoint using Excel VBA

ee97zzg

New Member
Joined
Jan 2, 2013
Messages
20
Hi VBA Gurus,

I would like to reference a worksheet object which is embedded in PowerPoint can someone advise how I can reference it using VBA.

My code is in Excel Workbook VBA Editor and I have added the powerpoint libary so I will be using th Ealy Binding technique.

The original name of the embedded worksheet is "Obect 1" I have renamed it to "Slide5Sec"

Thanks in advanced
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Re: How to refernce worksheet object embedded in Powerpoint using Excel VBA

Let's assume that pptSlide represents a slide from your presentation. Here's an example...

Code:
    Dim wb As Workbook
    Dim ws As Worksheet
    
    Set wb = pptSlide.Shapes("Slide5Sec").OLEFormat.Object
    Set ws = wb.Worksheets("Sheet1")
    
    ws.Range("A1").Value = "Hello World!"
    
    Set wb = Nothing
    Set ws = Nothing

Hope this helps!
 
Last edited:
Upvote 0
Re: How to refernce worksheet object embedded in Powerpoint using Excel VBA

Thanks Domenic this does exactly what it says on the tin. Brilliant mate thanks :)
 
Upvote 0
Re: How to refernce worksheet object embedded in Powerpoint using Excel VBA

hello, I also have a problema when I try to select a cell
what I wat to do is :
ws.range("A1").select.
I'm using the same code. but it is imposible to select.

any advise? thank you very much
 
Upvote 0

Forum statistics

Threads
1,213,507
Messages
6,114,029
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top