none
Help me build a Data Acquisition program to get a measurement devices data directly into microsoft excel on the fly RRS feed

  • Question

  • I have a temperature device connected to my computer where I want the data to go straight into an excel spreadsheet - one reading after the next, on the fly, populating the next open row until I choose to stop it.

    Can anyone provide some insight on how to do this ?  What software, what language, is needed to create a program such as this.  Sounds pretty easy... ?  I'm currently clueless on how to start and internet searchs haven't been very helpful so far.

    The device already has a driver and supplies that data to a web browser - but i can do anything with it there - needs to be on something I can do some further analysis upon.

    Many thanks in advance.

    EJ

    Monday, April 2, 2018 4:43 AM

All replies

  • Hi EmoLatte,

    You had mentioned that,"The device already has a driver and supplies that data to a web browser - but i can do anything with it there - needs to be on something I can do some further analysis upon."

    At present I am not aware that which specific device you are using to collect temperature data and whether it provide any feature to send data directly to Excel or not.

    But it is possible to fetch the data from URL to Excel.

    You can use VBA for this purpose.

    To use VBA, You not need to install anything. It is by default comes with Office.

    You can use it by pressing Alt + F11 Key. You can also open VBA Editor from Developer Tab in Excel.

    If Developer Tab is not visible then try to make it visible first.

    After opening a VBA Editor, You need to add code below to one module.

    Code:

    Sub Macro1()
    
        ActiveWorkbook.Worksheets.Add
        '----------change the URL in line below to make this code work
        With ActiveSheet.QueryTables.Add(Connection:= _
            "URL;http://finance.yahoo.com/q?s=usdCAd=x", _
            Destination:=Range("$A$1"))
            .Name = "q?s=usdCAd=x_1"
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .WebSelectionType = xlEntirePage
            .WebFormatting = xlWebFormattingNone
            .WebPreFormattedTextToColumns = True
            .WebConsecutiveDelimitersAsOne = True
            .WebSingleBlockTextImport = False
            .WebDisableDateRecognition = False
            .WebDisableRedirections = False
            .Refresh BackgroundQuery:=False
        End With
    End Sub
    

    After adding the code to module, you can replace the URL in code with your URL of temperature data.

    Then press F5 key to run the code. You will get out put like below. 

    Output:

    Below are the helpful References:

    1. Getting Started with VBA in Excel
    2. Show the Developer tab
    3. Run a macro
    4. QueryTables.Add Method (Excel)
    5. Object model (Excel VBA reference)

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 3, 2018 3:36 AM
    Moderator
  • Hi EmoLatte,

    Is your issue solved?

    I find that you did not follow up this thread after posting the issue.

    If your issue is solved then I suggest you to post your solution and mark it as an answer.

    If your issue is still exist then try to refer the solution given by the community members.

    If then also you have any further questions then let us know about it.

    We will try to provide further suggestions to solve the issue.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 10, 2018 7:58 AM
    Moderator