Ensuring size of active x list boxes

raccoon588

Board Regular
Joined
Aug 5, 2016
Messages
118
I have the following code and it works if the only thing i list is the font size. When i add the height and width i get an error. Run- time error '438': Objest doesnt support this property method.

is there anything i can do to get my active x list boxes to stop resizing?

I sent the integral height property to false but it continues to resize.

Code:
For Each OLEobj In ActiveSheet.OLEObjects


If OLEobj.progID = "Forms.ListBox.1" Then
   ' OLEobj
    OLEobj.Object.Font.Size = 12
    OLEobj.Object.Height = 47.25
    OLEobj.Object.Width = 141.75
End If
Next OLEobj
End Sub
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
usually when someone opens the file on a different PC and then i reopen it on mine.

I know activeX controls on worksheets are buggy although I personally never had problems with them. I was going to suggest using a ListBox from the Forms toolbar but that wouldn't let you change the font size.

Just a stab in the dark, try toggling the Visible Property after setting the font size and see what happens .
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

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