![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
I have an ActiveX ListBox on a worksheet that I populate at the user's request or upon start up. But I'm experiencing a strange problem: the list box changes in size (gets thinner and a bit shorter, which also affects the font inside the list box). I've also seen this before with command buttons (on a sheet that had many command buttons).
Anybody had this problem, and if so, is there a fix? I think I'm going to just change to using a form, but I'd like to know if there is a fix for future reference. Thank you, Russell |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Can't you just set the top, left, height properties on initializing? Or does that have no effect...
Just in case you missed the obvious... Tom |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
Yes, I did think of that but I think it was actually an issue with ScreenUpdating. I solved it by switching the order of some of my code.
Thanks for responding, Russell |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Apr 2002
Location: Sarasota, FL
Posts: 1,539
|
I believe this is a similar problem to the one I just posted (my check boxes aren't printing as they're displayed) and I was wondering what you did in your coding to help correct the problem. I definately checked left, top, font, and all that, but the boxes come up different from one another. It appears their position on the screen affects the printing somewhat, but I'm not sure...
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
Well, it's not just checking the top, left, etc., it's re-setting them at run time. So when your code runs or when your workbook opens, set the top, left, width, and height properties and see if that works.
-rh |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
An absolutely stupid suggestion, but there's no option on this control for Autofit is there? i.e. Autofit the control to house the text. (in my earlier days I remember the fun I had with automatically sized textboxes on userforms)
As I say, stupid, yet simple thing to check. |
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Apr 2002
Location: Sarasota, FL
Posts: 1,539
|
The properties all match (I haven't closed the workbook yet, so I don't thing anything is resetting), and I've tried both auto-fiting the text and not, the thing is, the controls look normal and sized correctly until I print or print preview. Maybe I need to go brush up on the proper way to insert objects.
Thanks for the help, however! |
|
|
|
|
|
#8 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
It will look like they match, but try setting them at run-time and see what happens. I'll bet that it will get rid of your problem (it worked for me!). Don't just trust the settings if things look wrong.
|
|
|
|
|
|
#9 |
|
Board Regular
Join Date: Apr 2002
Location: Sarasota, FL
Posts: 1,539
|
I put this code on the sheet containing the checkboxes:
Private Sub Worksheet_Activate() With CheckBox8 .AutoSize = False .Top = 60 .Left = 373.5 .Height = 19.5 .Font = TimesNewRoman .Width = 108 End With There are several checkboxes on the page, all of them should be the same width, height etc, as this code, I hoped, would set. But they still look different, ie the fonts, though almost identical, seem spaced different, and the check boxes are slightly different sizes. With a sore head... Corticus |
|
|
|
|
|
#10 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
Hmm. Yeah, I don't know what the deal is with the controls changing like that. Sorry my suggestion didn't help - as I said, it did work for my list box.
-rh |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|