Set ActiveX List Box Height

seleseped

Board Regular
Joined
Feb 1, 2005
Messages
59
I believe this has a simple answer but I'm having trouble setting the height of an ActiveX Control List Box. The list box is on an Excel 2013 spreadsheet and I would like to have the list box height be either 0 or 88. This is my code (the list box name is ACEI):

With ActiveSheet.Shapes("ListBoxACEI")
.Visible = True
.Top = Range("B4").Top
.ScaleHeight 0.78, msoFalse, msoScaleFromTopLeft
End With

The first two lines of code (.visible and .top) run properly. The .ScaleHeight line of code is what was recorded when I used the macro recorder to size the list box. The problem is each time the above code is run, the height of the list box gets incrementally larger by inconsistent increments. I tried setting the height using .Height 88 but get an error message "Run-time error '438": Object doesn't support this property or method.' IntegralHeight is set to True (but I have no idea what that means).

Can somebody point out my error. Many thanks in advance.
Seleseped
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
INDEED it does help! Many thanks. I was following the macro recorder code as an example and was totally led astray. Thank the Heavens for those like you who are willing to give your time and expertise! You saved the day.
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top