BritsBlitz
New Member
- Joined
- Jan 10, 2014
- Messages
- 34
- Office Version
- 365
- Platform
- 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?
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?