MSCOMM32 Control

M

Mark Ivey

Has anyone ever dealt with the MSCOMM32.OCX control via MS Excel?

I have an application I build recently, but I would like to automate it a bit. Every time I transfer the file from one PC to another, it takes a bit of time to set up. Does anyone have any experience with this type of automation?

The big problems are as follows:

Usually I have to make sure the PC it is going on has the MSCOMM32 file and that it is registered with Windows.

Once that pain-staking task has taken place I have to add the MSCOMM controls back to my userform.

After doing this all seems to be okay, but some of the items above can be difficult on some PCs.

Can this type of thing be packaged and or automated?
 
D

Dave Patrick

I don't have it here but this can easily be accomplished. I use a two-line
CMD shell script that uses xcopy in the first line to copy the OCX to the
user's %systemroot%\system32 directory then use regsvr32.exe on the second
line to register the control as part of a small Access/Excel installation
routine.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
Has anyone ever dealt with the MSCOMM32.OCX control via MS Excel?

I have an application I build recently, but I would like to automate it a
bit. Every time I transfer the file from one PC to another, it takes a bit
of time to set up. Does anyone have any experience with this type of
automation?

The big problems are as follows:

Usually I have to make sure the PC it is going on has the MSCOMM32 file and
that it is registered with Windows.

Once that pain-staking task has taken place I have to add the MSCOMM
controls back to my userform.

After doing this all seems to be okay, but some of the items above can be
difficult on some PCs.

Can this type of thing be packaged and or automated?
 
M

Mark Ivey

Dave,

That sounds great for the first half of this problem. I would be grateful if you could post your solution when possible.

Do you have any ideas on how to automate my code for a late binding scenario? I seem to have to re-add this control to my userform every time it is moved.

--
Mark Ivey
I don't have it here but this can easily be accomplished. I use a two-line
CMD shell script that uses xcopy in the first line to copy the OCX to the
user's %systemroot%\system32 directory then use regsvr32.exe on the second
line to register the control as part of a small Access/Excel installation
routine.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
Has anyone ever dealt with the MSCOMM32.OCX control via MS Excel?

I have an application I build recently, but I would like to automate it a
bit. Every time I transfer the file from one PC to another, it takes a bit
of time to set up. Does anyone have any experience with this type of
automation?

The big problems are as follows:

Usually I have to make sure the PC it is going on has the MSCOMM32 file and
that it is registered with Windows.

Once that pain-staking task has taken place I have to add the MSCOMM
controls back to my userform.

After doing this all seems to be okay, but some of the items above can be
difficult on some PCs.

Can this type of thing be packaged and or automated?
 
D

Dave Patrick

That shouldn't be necessary. All of my users are Windows XP now but it still
wasn't necessary when we were a mix of NT/2000/XP


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
Dave,

That sounds great for the first half of this problem. I would be grateful if
you could post your solution when possible.

Do you have any ideas on how to automate my code for a late binding
scenario? I seem to have to re-add this control to my userform every time it
is moved.
 
D

Dave Patrick

Sorry it took so long. Here's an example of what you might use.

net use Z: /d
net use Z: \\naras0\maintdata$\Field_Elect\Registration
attrib -h %systemroot%\system32\mscomct2.ocx
regsvr32 /u /s %systemroot%\system32\mscomct2.ocx
xcopy Z:\mscomct2.ocx %systemroot%\system32 /h /q /v /y
regsvr32 /s %systemroot%\system32\mscomct2.ocx
net use Z: /d

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
M

Mark Ivey

Dave,

I appreciate your response. I played around with the code a bit and made one of my own. You are welcome to use it if you would like...


--------------------------------------------------------------------------------

@echo off

IF EXIST C:\Windows\System32\MSCOMM32.OCX GOTO NOINSTALL

IF NOT EXIST C:\Windows\System32\MSCOMM32.OCX GOTO INSTALL




:NOINSTALL
echo.
echo MSCOMM32 is already on your system
echo.
@pause
GOTO END



:INSTALL
XCOPY MSCOMM32.OCX C:\Windows\System32 /V/-Y
echo.
echo MSCOMM32.OCX has been copied to your C:\Windows\System32 directory
echo.
@pause
echo.
echo Now the MSCOMM32.OCX file will be registered with the Windows registry
echo.
@pause
echo.
regsvr32 \windows\system32\MSCOMM32.OCX
echo.
echo Thank you for using the MSCOMM32 installer. Have a nice day!
echo.
@pause
GOTO END


:END


@echo on

--------------------------------------------------------------------------------


--
Mark Ivey
Sorry it took so long. Here's an example of what you might use.

net use Z: /d
net use Z: \\naras0\maintdata$\Field_Elect\Registration
attrib -h %systemroot%\system32\mscomct2.ocx
regsvr32 /u /s %systemroot%\system32\mscomct2.ocx
xcopy Z:\mscomct2.ocx %systemroot%\system32 /h /q /v /y
regsvr32 /s %systemroot%\system32\mscomct2.ocx
net use Z: /d

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
D

Dave Patrick

Glad to hear it helps.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
Dave,

I appreciate your response. I played around with the code a bit and made one
of my own. You are welcome to use it if you would like...


<snip>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top