I am creating a multipage userform that contains DTPicker controls on more than one page. The controls are linked to dates in two named ranges (of one cell each) called moeDateExchanged and csContractDate. When the userform is launched I want to the DTPickers to show the dates in the named ranges. (In other words the user can pick up where he left off.) In my Userform_Initialize code I include
However, this causes a runtime error:
'35788'
An error occurred in a call to the Windows Date and Time Picker control.
moeDTPicker1 is on the first page of the Multipage and csDTPicker1 is on the second page. If I comment out:
the form launches fine but if it is in the code (and even if I comment out
I get the error. Can anyone explain this or provide a workaround?
Code:
Private Sub Userform_Initialize()
moeDTPicker1.Value = Range("moeDateExchanged").Value
csDTPicker1.Value = Range("csContractDate").Value
End Sub
However, this causes a runtime error:
'35788'
An error occurred in a call to the Windows Date and Time Picker control.
moeDTPicker1 is on the first page of the Multipage and csDTPicker1 is on the second page. If I comment out:
Code:
'csDTPicker1.Value = Range("csContractDate").Value
Code:
'moeDTPicker1.Value = Range("moeDateExchanged").Value