The best way to do it is to use the MSComm control that comes with Visual Basic. Visual Basic Serial Communications Example. RS232 to Excel woorksheet. Re: VBA RS232 Class Can you be more specific as to what exactly is happening when you try to use it. I've used it with winxp, 7 64bit + excel 2003 & 2013 with no issues. Make sure that you have the correct comm parameters set. Also check if your application needs a particular flow control setting for the com port you are using. Are you sending the correct command strings to your serial device. Check the serial communications protocol requirements for your device. If your really stuck you can download free serial port monitor software which can show you serial data traffic on any comm port. Also you could try using software such as Realterm to sent and receive to you device to verify that you have valid comm settings & command strings. Hi all, This forum has been a great help to me in the last few months and I wanted to give something back. The evil within 2 wiki anime. Although I am no Excel or VBA expert.I have learnt one heck of a lot in recent times. World news forum. I have had some major issues using MSCOMM and finding information/support on the web. So I thought I would share how I got it working on an excel worksheet to communicate with a serial device. Keygen generator. Thanks Rob ---------------------------------------------------------------- First off, if you hav'nt already done so - you will need to obtain the MSCOMM32.OCX Active X library. Start here - You will need to register it. Go to command prompt and type the following - regsvr32 C: Windows System MSCOMM32.OCX You should get a message to indicate that the control has been registered. Then you may need to update the registry with this key - [HKEY_CLASSES_ROOT Licenses 4250E830-6AC2-11cf-8ADB-00AA00C00905] @ = 'kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun' As far as the registry stuff goes, I am no expert. This worked for me.and as far as I know it is legal. But if you have any concerns.or if you are not familiar with working within the registry.I would suggest doing some more research first! Now.you should be ready to program with MSCOMM!!! Open up a new Excel workbook. Make sure you can see the 'Control Toolbox (View>>>Toolbars>>>Control Toolbox). Rename your worksheet 'SerialPort'. Once you can see the toolbox- there should be a little toolbox icon. Click the icon and select 'Microsoft Communication Control' from the list. The cursor will change, allowing you to draw a box on the worksheet. This is the control. It does not matter where you place it - as when you open the workbook this will not be visible to the user. Once you have created the control, right-click and select 'View Code'. You should see something like - Private Sub MSComm1_OnComm() End Sub This is the 'OnComm' event and tells excel what to do when data is received from the serial port.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |