VB macro to get readings from digital scale connected via COM

Posted on 2007-07-26
Last Modified: 2010-04-30
Hi there,

I have a scale which is connected to the computer. I am using Hyperterminal to communicate with the sacale via COM#. The problem is that hyperterminal only takes 500 readings to be captured, while I need it to work for few days.

Is there anyway that VB macro can be developed in Excel inorder to take the readings directly to Excel?

Do you have any other solution?

Thank You
Question by:almotasam
    LVL 38

    Expert Comment

    With Visual Basic 6 it would be possible.  With just an install of Office (without Visual Studio also installed) I don't think it's possible, because the MSComm component is not registered for developer use with it.  There might be third party comm components out there you could use.

    One thing about hyperterminal is that you can set it to capture to a text file.  If you look at the Transfer menu, you'll see a "Capture Text" menu item that allows you to set a text file where the log entries will be stored.  Then it will capture the output of the window to the text file.  You could certainly process this text file after with VBA.

    Author Comment


    So I need to buy VB6 to do so, I will try to do that. With Hyperterminal it will only capture what ever is in that window which is max 500 lines isn't it? I need a continuous capture so I can take thousands of readings.

    LVL 38

    Accepted Solution

    If you go to Transfer menu > Capture Text, then you can set a text file and capture continuous data for as long as you wish.  

    Author Comment

    OK, I will try that for the next 24 hrs and I will come back to you.

    Thanks a lot

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now