• importing Data into Excel Real Time (Graphwrks)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » importing Data into Excel Real Time (Graphwrks)

    Author
    Topic
    #448891

    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?

    Viewing 0 reply threads
    Author
    Replies
    • #1099061

      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 “c:DataYourFile.xls”
      Set oSh = .ActiveSheet
      oSh.Range(“A1″).Value=”Foo”
      oSh.Parent.Save
      oSh.Parent.Close
      .Quit
      End With
      Set oXL=Nothing

      • #1099144

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

        • #1099147

          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?

    Viewing 0 reply threads
    Reply To: Reply #1099144 in importing Data into Excel Real Time (Graphwrks)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel