Page 1 of 1

Adjusting font size of action buttons with VBA

Posted: Wed Nov 29, 2017 1:24 pm
by Robster
Hello,

I'm trying to easily adjust the font size on any of my action buttons in a worksheet. I figured I just change the font size by editing the "OLEOobjects".

This is my piece of code which I use to try to adjust the font size:

Code: Select all

Debug.Print Blad1.OLEObjects("TIButton16").Object.Font.Size
Blad1.OLEObjects("TIButton16").Object.Font.Size = 12
Debug.Print Blad1.OLEObjects("TIButton16").Object.Font.Size
The first debug returns 112 as font size, which is correct. Then the second debug returns 12, due to the previous line changing the font size.

Unfortunately this doesn't seem to actually change something in the worksheet.

If I open the properties of the action button I can see it is still at size 112.

Does anyone know a solution to this problem?

Re: Adjusting font size of action buttons with VBA

Posted: Wed Nov 29, 2017 5:14 pm
by Wim Gielis
Hi there,

I ran accross the very same issue. Sometimes it works when you save, close and open the sheet, but it's not a guarantee.
So I decided to do it manually rather than automated.

Re: Adjusting font size of action buttons with VBA

Posted: Tue Dec 05, 2017 12:11 pm
by Robster
Interesting, I'll try it with opening and closing the workbook. It's unfortunate that there isn't an easier way.