How to extract an embedded worksheet from Powerpoint and save it using VB?

I have a bunch of Powerpoint presentations with embedded excel worksheets that I would like to throw into one Excel workbook.  I am trying to have Excel open each presentation and grab the embedded worksheet out of Powerpoint and save it into a single directory and then have all of the workbooks condensed into a single workbook using VB.  Any help I can get on this is greatly appreciated.

Thank you in advance!
Mike
mander6618Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
this will loop through all slides in a presentation looking for an excel workbook / spreadsheet
Sub GetWorkSheetName()
    ' ignore errors when shape is not an Excel Workbook
    On Error Resume Next
    
    ' need to include in references "Microsoft Excel [version] Object Library"
    Dim xl As Excel.Workbook
    
    ' all shapes on a slide as the embedded excel workbook is a "shape"
    Dim current_slide_shapes As Shapes
    For j = 1 To ActivePresentation.Slides.Count
        ' get all the shapes on the current slide
        Set shp = ActivePresentation.Slides(j).Shapes
        ' loop through all the shapes looking for an excel workbook
        For i = 1 To shp.Count
            Set xl = shp(i).OLEFormat.Object
            If (xl Is Not Null) Then
                ' found a workbook
                ' xl now holds the reference to the embedded workbook
                Debug.Print xl.Name
            End If
        Next i
    Next j
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.