Calendar in Excel shrinks
I am using Excel VBA. I added a 开发者_开发百科calendar control so that users can pick the date from the calendar. I noticed something that whenever the excel file is opened the Calendar shrinks smaller and smaller. Now I can see that the calendar will disappear after reopening the file several times. Any ideas? please help Thanks,
You can get around this by adding
Calendar1.Width = 165
Calendar1.Height = 165
to your code (right click on control and "see code". I've used 165 (millimeters on my system), but you can check the properties of the control, once you have it the size you want, to get the values.
I found the opposite worked for me (Excel 2007) I had exactly the same problem but only when I changed the format to "move or resize with cells" that the calendar stayed the same size after file save and close. Your answer put me on the right path though, thanks!
I've seen this behaviour before with other controls. I think it's a bug that is linked to the control's resize setting, even though cells aren't being resized.
Try the following in design mode:
- Right-click control and select Format Control
- In Properties tab, select 'Don't move or size with cells'
精彩评论