Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VBA Serial Port Communication

144 views
Skip to first unread message

AJB

unread,
Jul 29, 1999, 3:00:00 AM7/29/99
to
I am using Excel97 to log data coming from a controller connected to the
serial port of my PC (Win 95). I need to poll the controller every few
minutes to read the value. I have the command strings built, but can not
get them to the serial port. In the DOS basic world, we used the OPEN COM1
command and then sent the string. This does not work in VBA. How do I open
the COM port and send/receive data in VBA?

I saw an earlier post regarding XMCommVBA and downloaded that file.
However, I can't get XMComm to be recognized as a valid object to work with.
Same is true for MSComm. I may not be loading/initializing these add-ins
correctly because I have never added anything into VBA before. Any help
would be greatly appreciated.

Another possibility that I heard discussed was call Windows APIs to do the
serial communication. But again, I am a newbie to using Windows APIs and
don't know if this is possible in VBA or how to do it.

TIA


InfinitOp

unread,
Aug 7, 1999, 3:00:00 AM8/7/99
to
if you receive a solution to your problem, could you please pass it along?

i am trying to accomplish something similar with VBA in Office 98.

thanks


--Tim
remove ".nospam" when replying

Richard Grier

unread,
Aug 7, 1999, 3:00:00 AM8/7/99
to
Hi,

Have you tried the XMCommVBA.ocx that you can download from my homepage?

--
Richard Grier
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO 80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order. For faster service contact the publisher at
http://www.mabry.com.

0 new messages