Solved

Revealing a hidden pop up calendar in Excel VBA

Posted on 2008-10-31
10
994 Views
Last Modified: 2012-08-13
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
Comment
Question by:jezza12
  • 5
  • 3
  • 2
10 Comments
 
LVL 17

Expert Comment

by:ExcelGuide
ID: 22849188
could you try:
me.Calender1.Visible = True

or

UserForm1.Calender1.Visible = True
0
 

Author Comment

by:jezza12
ID: 22849575
Thank you for your response.
I tried both options but still get the same result - the calendar doesn't reveal itself.
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 22849655
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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 17

Expert Comment

by:ExcelGuide
ID: 22849772
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
 

Author Comment

by:jezza12
ID: 22854248
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
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 50 total points
ID: 22855058
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
 

Author Comment

by:jezza12
ID: 22855124
Wayne

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

Regards Jezza
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 22855158
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
 

Author Comment

by:jezza12
ID: 22855224
Thanks once again.
0
 

Author Closing Comment

by:jezza12
ID: 31512002
Thank you for your prompt assistance.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Math Equation 23 82
Remove duplicates using cell values VBA 2 28
Sub or Function is not defined 6 26
Excel VBA get Access table names with ADO 2 20
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now