• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1103
  • Last Modified:

Revealing a hidden pop up calendar in Excel VBA

How do I unhide a calendar from a user form? I am trying to reveal a calendar after a combo box is selected using the  "Mouse Down" event.The calendar itslef has been inserted onto the user form. I have turned the visible properties of the calendar to "false" .The code in the"mouse down" event for the combo box is: Calendar1.Visible = True. After selecting the combo box nothing happens. Please help.
Private Sub ComboBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    
    Calendar1.Visible = True
    
  
End Sub

Open in new window

0
jezza12
Asked:
jezza12
  • 5
  • 3
  • 2
1 Solution
 
ExcelGuideConsultantCommented:
could you try:
me.Calender1.Visible = True

or

UserForm1.Calender1.Visible = True
0
 
jezza12Author Commented:
Thank you for your response.
I tried both options but still get the same result - the calendar doesn't reveal itself.
0
 
Wayne Taylor (webtubbs)AstronautCommented:
Hi jezza12,

It works fine for me. Can you confirm the MouseDown event is being called? You can use a MsgBox, like this....

    Private Sub ComboBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)    
        Calendar1.Visible = True      
        MsgBox "Mouse Down"
    End Sub

Regards,

Wayne
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ExcelGuideConsultantCommented:
hi webtubbs,

I guess I start to understand this problem. Because I actually dont see anything as well BUT when I randomly click on the userform I start seeing the calendar partially...maybe this user has the same problem?

jezza, could you confirm?
0
 
jezza12Author Commented:
Hi Wetubbs and Psychotec,

Webtubbs, I tried your suggestion and the message box IS displayed on the mouse down event. So the actual event seems to be working.
In response to Psychotec, you seem to be experiencing exactly the same problem as me. No calendar is seen on the mouse down event. However, when I randomly click on the userform the calendar partially reveals itself.

Regards  Jezza
0
 
Wayne Taylor (webtubbs)AstronautCommented:
Jezza,

Try Repainting the form in the MouseDown event....

    Private Sub ComboBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)    
        Calendar1.Visible = True      
        Me.Repaint
    End Sub

Wayne
0
 
jezza12Author Commented:
Wayne

Thank you - that seems to have done the trick. Just out of curiosity - is this a bug?

Regards Jezza
0
 
Wayne Taylor (webtubbs)AstronautCommented:
Yes and No. There's generally no problem with the normal Forms control, but specialist controls, such as the Calendar, can sometimes have problems.

Wayne
0
 
jezza12Author Commented:
Thanks once again.
0
 
jezza12Author Commented:
Thank you for your prompt assistance.
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now