I've just tried to add an OlkDateControl
to my Excel VBA UserForm but it tells me it can't load the control.
I had the control in my Toolbox
already, and I'm pretty sure I've used it before but can't figure out how.
I've made sure this new workbook has Outlook 16.0 Object Library
in the references
From an MS VBA API guide:
You can only add this control to a form region in an Outlook form using the forms designer; you cannot add this control to a Visual Basic UserForm object in the Visual Basic Editor.
I don't really know what this means - What is a form region? Can I create an Outlook form in Excel?
I tried creating it at run time:
Private Sub CommandButton1_Click()
Dim x As New OlkDateControl
x.Value = "01/01/2021"
End Sub
Which runs fine but there's no sort of x.Show
or way to show the control on the UserForm.
I also tried adding it to the UserForm
Dim x As New OlkDateControl
Set x = UserForm1.Controls.Add("OlkDateControl")
Any ideas?
(Or a good DatePicker alternative would also be great!)