Use FileSystemObject to see if the file is there. If it is not, copy it and
register it with a bat file that contains the following 2 lines:
xcopy mscomct2.ocx c:\windows\system32\mscomc2.ocx
regsvr32 /s MSCOMCT2.OCX
Thanks, Cheryl.
Could you please clarify how I could use this FileSystemObject and how I
could generate that bat file?
For now I'm using the API-only approach Stephen Lebans has at
http://www.lebans.com/monthcalendar.htm
It's working well. But, sometimes I'm getting the error message:
"YOu must instantiate the MonthCalendar Class object before you call this
function The code behind the sample Form shows you how to do this in the
Form's Load event
This must appear here!
Create an instance of our Class
Private Sub Form_Load()
Set mc = New clsMonthCal
You must set the class hWndForm prop!!!
mc.hWndForm = Me.hWnd"
> Use FileSystemObject to see if the file is there. If it is not, copy it and
> register it with a bat file that contains the following 2 lines:
[quoted text clipped - 8 lines]
> > if not to copy and register it programmatically (VB) during the form or app
> > downloading?
Cheryl - 28 Sep 2005 20:37 GMT
Dim fs As FileSystemObject
Set fs = New FileSystemObject
If Not fs.FileExists("c:\windows\system32\mscomc2.ocx") Then
Shell App.Path & "\regmscomc2.bat"
End If
This would assume that regmscomc2.bat is in the same path as the program you
are running and has these two lines in it
> > xcopy mscomct2.ocx c:\windows\system32\mscomc2.ocx
> > regsvr32 /s MSCOMCT2.OCX
You'll have to put your copy of mscomct2.ocx in a location where it can be
copied from.
> Thanks, Cheryl.
>
[quoted text clipped - 27 lines]
> > > if not to copy and register it programmatically (VB) during the form or app
> > > downloading?