2

I have a powerpoint presentation with an excel workbook embedded in one of the slides. I also have a userform that I want the user to input information into, I want to take this information and then edit the excel sheet with the relevant information.

I don't know how to access the excel sheet within powerpoint though so I can change the values of the cells.

0

1 Answer 1

3
Sub a()

Dim oSl As PowerPoint.Slide
Dim oSh As PowerPoint.Shape

Set oSl = ActivePresentation.Slides(1)

Set oSh = oSl.Shapes(1)

With oSh.OLEFormat.Object.Sheets(1)
    .Range("A1").Value = .Range("A1").Value + 1
    .Range("A2").Value = .Range("A2").Value - 1
End With

Set oSl = Nothing
Set oSh = Nothing

End Sub  

Inspired in this code

2
  • I've looked at several solutions for ppt embedded in Excel and have not been successful in being able to make anything work. Not helpful.
    – Mike
    Dec 24, 2010 at 19:48
  • @Mike Ok. I'll try to put the thing together and edit the answer. Dec 24, 2010 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.