Results 1 to 3 of 3

Thread: How to reference worksheet object embedded in Powerpoint using Excel VBA

  1. #1
    New Member
    Join Date
    Jan 2013
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    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

  2. #2
    MrExcel MVP
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    18,555
    Post Thanks / Like
    Mentioned
    24 Post(s)
    Tagged
    4 Thread(s)

    Default 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 by Domenic; Mar 14th, 2019 at 03:31 PM.

  3. #3
    New Member
    Join Date
    Jan 2013
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default 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

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •