LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default MSCOMM32 Control in Excel 2003 VBA

I am experiencing very strange behaviour with the MScomm32 control in
Excel 2003 VBA.

The control is registered, and I can install it in my spreadsheet, but
when running (via Sub Worksheet Change), it appears to execute once (I
have a Belkin USB/RS232 adaptor which has status and TX/RX LEDs).

On successive executions, I get error messages that the port is
already open (I do set the PortOpen property to False at the end of
each run), but if I do not execute the .portopen to true, it returns
an error saying the port is not open!).

I am using MSCOMM32.ocx version 7-26-95, I believe installed with my
VB4.

Also, I notice that when I exit Excel, the status LED on the USB/RS232
adaptor blinks.

It seems to me that there is some setting in the com port status that
I am not maintaining or Set/resetting in the correct order.

Thanks in advance for your assistance!
TomC
--------------------------------------------------------

Here is my code:
[obviously with some commented remnants of my failed attempts.]

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MSComm1.Enabled = True
'MSComm1.PortOpen = False
MSComm1.Activate
'MSComm1.PortOpen = False
'MSComm1.PortOpen = False
MSComm1.PortOpen = True
MSComm1.Settings = "9600,N,8,1"
MSComm1.Handshaking = NoHandshaking

'MSComm1.PortOpen = True
MSComm1.Output = "Hello out there!"
MSComm1.PortOpen = False
'MSComm1.Delete

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003: Control tab in "Format Control" doesn't show up. Tom Ogilvy Excel Programming 0 January 19th 07 12:22 AM
Excel 2003: Control tab in "Format Control" doesn't show up. Dave Peterson Excel Programming 0 January 18th 07 08:02 PM
MSCOMM32 Control Mark Ivey Excel Programming 6 July 30th 06 03:49 AM
MSComm32 Axehandler Excel Programming 0 October 11th 04 12:44 AM
serial port mscomm32.ocx in excel Brian Excel Programming 0 July 25th 03 11:22 PM


All times are GMT +1. The time now is 03:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"