Dim MSComm1 As Object
Set MSComm1 = CreateObject("MSCOMMLib.MSComm")
but it does not work on another computer that has MSCOMM32.OCX in the system32 folder and it is registered.
I get an error Activex component cannot create object.
I do not want to add a reference to the Microsoft Comm Control 6.0 because this would cause errors on other computers that do not have the OCX.
Visual Basic ClassicMicrosoft Access
Last Comment
Eamon
8/22/2022 - Mon
Scott McDaniel (EE MVE )
Are you certain this is the code that is causing the problem?
If so, you may have an issue with that control. Have you tried re-registering the control, or re-installing the redistribution package for those controls?
rockiroads
I know it may be registered, perhaps there is a problem with it though, have you tried to unregister then register again? regsvr32 /u to unregister
I have put it on 8 computers in one of our stores. I did not work on any of them. It could hardly be a problem with all 8.
I will try anyway just to make sure.
I have vb6 installed on my computer could this be why it is working on mine and not the others.
rockiroads
ok, I was thinking it was just one when u said another computer
Is the the same version of that ocx? you could copy yours onto there, into a different directory to win\system32 then try to register that.
Eamon
ASKER
Tried the unregister then register again did not work.
Could it be something stupid like that MSCOMMLib.MSComm isn't MSCOMM32.OCX
Will try copying my file
rockiroads
You should expect the unexpected and not assume users will have it. What I have tended to do is copy all the libs I use into the local directory where app is installed then register it.
Have just noticed in the store that when I go to add a reference to the ocx that it is not in the list (see jpg)
I had to browse to the ocx.
Is it registered correctly or is there something else I need to do.
I have another program that tries to make sure that each computer has the required files.
It does the following
Shell ("regsvr32 /s mswinsck.ocx")
Shell ("regsvr32 /s MSCOMM32.OCX")
Shell ("regsvr32 /s MSINET.OCX")
Shell ("regsvr32 /s cgPrint") ' this is my own dll
Could this be causing a problem. Also can you have the same file in two different folders registered.
What I mean is could mscomm be somewhere else on the computer and registered. Comm.jpg
Eamon
ASKER
I browsed to c:\windowa\system32\mscomm32.ocx and added the reference but I still get the error.
I have a a small test mdb that has the comm control on a form and tried that and that worked.
It must be just something stupid I am doing.
MsgBox Err.Description, vbCritical, "ERROR In CustDisplayInitialize"
MsgBox "You will not be able to use the CustomerDisplay until this problem is solved.", vbInformation, ""
gblCustDisplayCommPort = 0
End Sub
Eamon
ASKER
rockiroads
I have registered it manually and there is no error.
I agree with you that it must be something to do with the registering of the control.
I will take a fresh look at it on Monday.
Also, MS has released several Security Bulletins for a LOT of ActiveX controls ... are you certain the machine where you're having troubles is up to date with all Windows/Office Service Packs? I don't see that actual control listed, but it's heavily dependent on other controls, so that may be your issue.
Eamon
ASKER
On one of the computers in the stores I have a vb6 program installed that uses the comm control.
This program is working fine. I don't really understand how the licensing works.
Do I not have a license for the vb6 program running in the store.
Eamon
ASKER
I mentioned previous to this that I have a access form with the control on it and this worked. So how come I have a licence for that.
If so, you may have an issue with that control. Have you tried re-registering the control, or re-installing the redistribution package for those controls?