Results 1 to 3 of 3
  1. #1
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calendar Control (Excel 2000)

    I have used the MonthView control in an Excel tool I'm writing and want to know how best to handle the situation if the end user's PC does not have the appropriate file (MSCOMCT2.OCX). This control is launched from a button on a form and is used to populate a text field with the selected date.

    If they do not have this .ocx file in their system, when will the error occur? Will it happen when they open my .xls file (because one of the references is missing) or will it only happen they click the button to launch the calendar?

    How common is this file? Do I even need to be concerned? I'm thinking maybe it's a very basic control that is loaded with standard Office.

    I want to add code that handles the case where this file does not exist to offer an alternate way for them to enter a date into a text box w/o seeing any errors.

    Thnx, Deb <img src=/S/thinks.gif border=0 alt=thinks width=15 height=15>

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Calendar Control (Excel 2000)

    No, unfortunately, that one is typically not present in Windows 98 (not sure about new installs of Windows 2000 or XP). If you have VB or Office Developer, you can use the package and deploy wizard to create a setup file to install and register it on the users' PCs. This was the first package I created, and it loads way too much stuff. You really can make it very lightweight.

    So...I have a Word document that contains a macro that copies my (Word) template solution to the user's PC. The template checks for the control and, if it doesn't find it, it launches the setup. Like this:

    <pre>' Check for MSCOMCT2.OCX - DatePicker
    If Dir("c:windowssystemmscomct2.ocx") = vbNullString And _
    Dir("c:winntsystem32mscomct2.ocx") = vbNullString Then
    strMessage = strMessage & " However, I need to add a file to your system " & _
    "using a different Setup program. This will only take a minute. " & _
    "You will need to click the ''big button'' to install the file."
    MsgBox strMessage, vbExclamation + vbOKOnly, "Almost there!"
    Shell "serversharefoldersetup.exe", vbNormalFocus
    Else
    MsgBox strMessage, vbInformation + vbOKOnly, VersionToGet
    End If</pre>

    Hope this helps.

  3. #3
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Control (Excel 2000)

    Rats! As I suspected. I can't use any setup or install wizard for any of my projects - my end users won't tolerate that at all so I'm stuck with always using the bare minimum set of controls that are available with all versions of Excel. I have both xl97 and xl2000 on my Win2k system and my project works fine but I can't depend on that being the case.

    I think I'll do a simple 'on error' statement at workbook open and if gets triggered I'll just resort back to the simple manual date entry for those text fields.

    Thanks for the bad news <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Deb <img src=/S/cauldron.gif border=0 alt=cauldron width=20 height=20>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •