Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ControlSource Powerpoint to Excel

Status
Not open for further replies.

sirhobbit

Technical User
Aug 24, 2003
4
AU
Hi all.
I am trying to run a user form in Powerpoint with a textbox (or textboxes) linked to certain cells in a Excel spreadsheet. Anybody know how to do this?
 
sirhobbit,

1. you need to set a reference to the Excel Object Library in menu item Tools/References

2. Here's some sample code that could run from a CommandButton on your form...
Code:
    Dim xlApp As Excel.Application, xlWbk As Excel.Workbook
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Workbooks.Open "C:\aTest.xls"
    Set xlWbk = ActiveWorkbook
    With xlWbk.Worksheets(1)
        .Cells(2, 2).Value = TextBox1.Text
    End With
    xlWbk.Close
    Set xlWbk = Nothing
    Set xlApp = Nothing
This code put the text from Textbox1 in Cells(2,2) on Worksheets(1)

Hope this helps :)

Skip,
Skip@TheOfficeExperts.com
 
Thanks Skip!
That has gotten me half-way there - I should have worded my question better. Now I need to have the text boxes contain the text that is in a particular cell of the excel sheet when I open them up in powerpoint. I tried reverse engineering the code you gave me to no avail anybody have any ideas?
Thanks in advance.

Sirhobbit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top