Calendar Control

yash

New Member
Joined
Oct 29, 2004
Messages
18
Hi guys,

I need a free calendar control to use in a userform in excel VBA. Please let me know instructions on how to use this also, if possible.

Thanks,
Yash :eek:
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
There is already one built in.
In the VBE goto Tools, Reference, Browse, All File Types and make a reference to C:\Program Files\Microsoft Office\Office10\mscal.ocx
This will create an entry that says something to the effect of microsoft calander control. Place a check mark in teh box next to it and press ok.
Then goto tools, additional controls and add Calander Control 10.0. This will add a item to your controlbox that looks like a grid. It will be your calander. Here is some sample code on how you might interact with it.

Code:
Private Sub Calendar1_Click()
Selection = Calendar1.Value
Unload Me
End Sub

Private Sub CommandButton1_Click()

Calendar1.Value = Date
Selection = Calendar1.Value
Unload Me
End Sub

Private Sub CommandButton2_Click()
Unload Me
End Sub

Private Sub UserForm_Initialize()
If IsDate(ActiveCell.Value) Then
      Calendar1.Value = DateValue(ActiveCell.Value)
Else
      Calendar1.Value = Date
End If
End Sub
 

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
Did you try using the below instructions with office 11? (Cuase they should work)
 

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862

ADVERTISEMENT

There is no mscal.ocx to be found. No ocx file at all.

RAM
 

XLGibbs

Well-known Member
Joined
Feb 25, 2005
Messages
2,446
RAM,

You should be able to see it as a control using Insert Object from the code window. If Calendar control is not there, you may not have MS Access installed on your machine. As I understand things, it is the mscal.ocx is installed as part of the Access libraries...
 

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862

ADVERTISEMENT

Insert - Object. There is no Calendar control under the Create New tab. No, I don't have Access.

RAM
 

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862
I will try that. I'll let you know.

Thanks,

RAM
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,987
Messages
5,834,720
Members
430,313
Latest member
smartykatwinks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top