Using The Legacy Calendar Control In Excel 2010
Microsoft discontinued the legacy calendar control, MSCAL.OCX, in Excel 2010. Here's how to bring it back to run programs written with that control.
Important Note: The Active-X calendar control can be registered for Office 2010 32-bit, but it will not work on Office 2010-64-bit. Developers who use the legacy Calendar Control (or the new Date Picker - mscomct2.ocx) are advised to stay with the 32-bit version of Office 2010. There is no official replacement for the much-loved Active-X calendar control or date picker, as shown in the following article by Microsoft:
Active-X Calendar Control Or Date Picker Only Work In 32-Bit Office 2010
To use the old MSCAL.OCX control, it must be registered to Windows 7:
FOR 64-BIT WINDOWS 7, HERE'S HOW:
(1) First, you must perform this on EVERY computer that has 2010
(2) Obtain MSCAL.OCX and the Help file. It's easy to find on the Web.
(3) Copy both files to the following directory: C:\Windows\SysWoW64
(4) Click the Windows 7 Start Button and in the Search area, type "command"
(5) The search will bring up a number of items, including "Command Prompt" at the top
(6) Right click the "Command Prompt" banner, and select "Run as Administrator"
(7) At the command prompt, enter: %systemroot%\SysWoW64\regsvr32.exe mscal.ocx
(8) This should successfully register your legacy MSCAL.OCX.
(9) This worked for me on a Vanilla install of 64-Bit Windows 7 and Excel 2010
FOR 32 BIT WINDOWS 7, HERE'S HOW:
(1) First, you must perform this on EVERY computer that has 2010
(2) Obtain MSCAL.OCX and the Help file. It's easy to find on the Web.
(3) Copy both files to the following directory: C:\Windows\System32
(4) Click the Windows 7 Start Button and in the Search area, type "command"
(5) The search will bring up a number of items, including "Command Prompt" at the top
(6) Right click the "Command Prompt" banner, and select "Run as Administrator"
(7) At the command prompt, enter: %systemroot%\System32\regsvr32.exe mscal.ocx
(8) This should successfully register your legacy MSCAL.OCX.
Once The Control is registered, it can be added to the Control Toolbox available in the VBA area of Excel:
Select the calendar control from the list of available Active-X controls:
Once it is selected, it can be used from the toolbox:
The control uses the "Click" event as shown below:
Program Code
Private Sub Calendar1_Click() ' ******************************************************** ' Update Date Based on Calendar Click ' ******************************************************** dteDateSelected = Calendar1.Value End Sub