+ Reply to Thread
Results 1 to 4 of 4

frmCalendar

  1. #1
    Forum Contributor
    Join Date
    02-24-2005
    Posts
    154

    frmCalendar

    I have a worksheet which last year had a working frmCalendar in it.
    This year when I click on the same macro button that called up the calendar, it says 'Compile Error' 'Variable not defined'
    I have had a look at the properties of my macro and when I call up frmCalendar, the form appears but no calendar.
    Don't know where it went or how I get it back.
    I have had a look in the Additional Controls list to see if I can get another calendar but there is'nt one in the list.
    Any ideas ??

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by grahammal
    I have a worksheet which last year had a working frmCalendar in it.
    This year when I click on the same macro button that called up the calendar, it says 'Compile Error' 'Variable not defined'
    I have had a look at the properties of my macro and when I call up frmCalendar, the form appears but no calendar.
    Don't know where it went or how I get it back.
    I have had a look in the Additional Controls list to see if I can get another calendar but there is'nt one in the list.
    Any ideas ??
    Hi,

    Have you added 'Option Explicit' to your sheet? (if so then comment it out and try again, then look for a variable that you have not defined)

    Did you check for variables to ensure that all are defined?

    Do you have an old (Backup) copy of this file? - can you check what was in the file when it did work?

    Have you deleted a Sheet that the calendar depended on?

    any more clues, or can you post a sample of your code (excluding your private data)

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    If I remember correctly the calendar control does not come as part of excel and there have been many different and incompatible versions of calendar controls in the past.

    The chances are that either the calendar control you were using has been superseeded or that you are running on a pc that does not have it installed.

    When you bring up a used form in VBA you will see the controls toolbar the calendar should appear on that. If not rightclick the toolbar and it will offer the option of additional controls. This will list all available controls installed on your pc.

    I have two calendar controls installed and the useful MSDateandTimePicker control which is a nice simple thing to use for selecting dates.

    Hope this helps

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    It is a two step process to fix your Calendar Control ...

    1. Make sure to copy the file mscal.ocx in its directory C:\Windows\System32

    2. Then you have to register this control, by doing the following :
    Click Start then Run and type: regsvr32 mscal.ocx and click OK

    HTH
    Carim

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1