# How to reference worksheet object embedded in Powerpoint using Excel VBA



## ee97zzg (Mar 14, 2019)

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


----------



## Domenic (Mar 14, 2019)

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


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


----------



## ee97zzg (Mar 14, 2019)

*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


----------



## jlsainz (Sep 23, 2019)

*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


----------

