Hello,

As the title explains I am having problems with a userform showing todays date. I had datepicker control originally on my userform but I could not get it to default to todays date when using the file on both 2007 & 2010. I then used a control called monthview which is not available on 2007. I decided that the easiest way would be to use a textbox on the userform with the following code:

Private Sub UserForm_Initialize()
TextBox1.Value = Format(Date, "dd/mm/yyyy")
End Sub
This worked great on my 2007 version at home but to my amazement when I tried it on 2010 version at work I am getting the following error:

Compile Error:
Cant find project or library

If I change the first line to UserForm1 the macro runs but no date is in the textbox!!!!!

Can anyone help??

This is very annoying for such a simple operation.


Thanks,

Tony.