Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Serial Input into Visual Basic

Status
Not open for further replies.

DavidBa

Vendor
Oct 18, 2000
2
0
0
GB
I am wanting to take serial RS232/RS485 data via COM1 (or COM2)into EXCEL '97, there does not seem to be a Visual Basic equivalelnt to BASIC

OPEN "COM1:4800,N,8,RS,DS 0,BIN" For Input As #1
Y$=Input$(1, #1)

etc.

Has anyone found a solution or a patch.
[sig][/sig]
 
I'm looking at some of our code and we added a component called "Microsoft Comm Control 6.0". With this we are able to do the following:
Code:
MSComm1.CommPort = Val(sCommPort)
MSComm1.Settings = "38400,N,8,1"    '38400 baud, no parity, 8 data, and 1 stop bit.
MSComm1.InputLen = 1
MSComm1.PortOpen = True
I can't give any more help than this as I did not write this code.

HTH.
Patty [sig][/sig]
 
Thanks Patty,

I shall give it a try, but first to find out where to get the component and then how to add it and to what.

But thanks.
[sig][/sig]
 
The Microsoft Comm control is a standard part of Visual Basic 5.0, and can be "added" to your VB project by going to the menu Project | Components (or press Ctrl-T) then scroll down the list box until you come across Microsoft Comm Control (mine is version 5.0).
Be sure to hit Apply when you're done. You will then find a new icon on the toolbox (View | Toolbox if it's not visible) which looks like a phone on top of a modem. If you need some sample code reply to this thread and I'll post some - I believe I actually have some which I documented... :) [sig][/sig]
 
DavidBa:
I have been fighting this same problem for some time, and the info that I have gleaned is that this feature is not useable with the learning edition which I am using. We can bring the telephone Icon to the list of objects but it wont play. Instead we get the message to the effect that we are not licensed to use same etc. Hope this is of some help.
73 RSH [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top