Calendar code not working
Rob,
Very good news to hear that a Repair Installation of Office 2007 cleared up
the problem. It was about to make me crazy! And very good of you to post
back with the solution. Even better of you not to have just stood around
waiting for an answer to be handed to you and continued to think and dig
around and work towards a solution on your own.
Time wasted? Not a moment - what research and effort I did put out all goes
toward getting a little smarter in some areas that I had to dig into.
"RobN" wrote:
I have the following code to bring up the Calendar control. When I
converted the excel workbook from XP version to 2007 version on my home
computer it worked fine, but when I open it on my office computer I get a
message saying "Object required". When I open the older version on my
office computer, the Calendar code works OK.
Can you please also advise what code I need to control the size of the
Calendar?
Rob
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Application.Intersect(Range("H2"), Target) Is Nothing Then
Calendar3.Left = Target.Left + Target.Width * 2 - Calendar3.Width
Calendar3.Top = Target.Top + Target.Height * 7.5
Calendar3.Visible = True
' select Today's date in the Calendar
Calendar3.Value = Date
ElseIf Calendar3.Visible Then Calendar3.Visible = False
End If
End Sub
|