Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    importing Data into Excel Real Time (Graphwrks)

    Hi,

    I am currently using a graphing software which allows VBA. What I would like to do is add a control button which will have the ability to update a excel table each time the button is clicked.

    Was wondering if anyone has a sub example I could work with to run excel in the background in VBA from another application and import data into my table each time I click the button?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: importing Data into Excel Real Time (Graphwrks)

    After setting a reference to the Excel object library:

    Dim oXL as Excel.Application
    dim oSh as Worksheet
    Set oXL = New Excel.Application
    With oXL
    .Visible=True
    .Workbooks.Open "cataYourFile.xls"
    Set oSh = .ActiveSheet
    oSh.Range("A1").Value="Foo"
    oSh.Parent.Save
    oSh.Parent.Close
    .Quit
    End With
    Set oXL=Nothing
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: importing Data into Excel Real Time (Graphwrks

    Thank you, I will try this. How do I set a reference to excel though?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: importing Data into Excel Real Time (Graphwrks

    In the Visual Basic Editor for the Office applications, you set a reference in Tools | References... Does the Visual Basic Editor in Graphworks have this menu option?

Posting Permissions

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