VBA in MacOS to change color of the font in a Shape

BritsBlitz

New Member
Joined
Jan 10, 2014
Messages
29
Office Version
  1. 365
Platform
  1. Windows
I have a VBA code to change the font color of a button when you click on it (Form Control, not Active X). If the current font color is Black, it will change to Orange once you click on the button. (FC is defined as Shape and is the Forms Control button I'm clicking on). On a PC, the code works fine. On a MAC, I get an error.

For PC, I used:
If FC.TextFrame.Characters.Font.Color = RGB(0, 0, 0) Then
FC.TextFrame.Characters.Font.Color = RGB(255, 102, 0)


When I run the same code on a MAC, I get an error and it seems like MAC doesn't like the .TextFrame.Characters. reference.
The error on a MAC is: "Run-time error '1004': Method 'TextFrame" of object 'Shape' failed

I tried recording the macro to see how MAC handles it, but it's different because you have to first select the button, then change the font color. The recorded macro is the same on PC and MAC which isn't helpful:
With Selection.Font
.Size = 12
.Underline = xUnderlineStyleNone

.Color = 15773696
End With

Any feedback if there is an alternative to .TextFrame.Characters.Font.Color = RGB(x.x.x) on a MAC?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,221,528
Messages
6,160,343
Members
451,638
Latest member
MyFlower

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