ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MSCOMM32 Control (https://www.excelbanter.com/excel-programming/368212-mscomm32-control.html)

Mark Ivey

MSCOMM32 Control
 
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?

--
Mark Ivey

Dave Patrick

MSCOMM32 Control
 
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

"Mark Ivey" wrote:
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?

--
Mark Ivey



Mark Ivey

MSCOMM32 Control
 
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
"Dave Patrick" wrote in message ...
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

"Mark Ivey" wrote:
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?

--
Mark Ivey



Dave Patrick

MSCOMM32 Control
 
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

"Mark Ivey" wrote:
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



Dave Patrick

MSCOMM32 Control
 
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



Mark Ivey

MSCOMM32 Control
 
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
"Dave Patrick" wrote in message ...
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



Dave Patrick

MSCOMM32 Control
 
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

"Mark Ivey" wrote:
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




All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com