Interrupting native functions

JRosten

New Member
Joined
Dec 20, 2018
Messages
2
Hi all,

I'm trying to change the "automatic" font colour to my company standard colour in Excel 2016. It seems it used to be possible to set this colour in Windows "Personalise" in previous versions of Windows, but Windows 10 works differently and doesn't allow this any more. VBA seems to think the automatic colour is constant, so I can't change the colour itself (correct me if I'm wrong).

So my current idea is to figure out how Excel calls the VBA font changing function, interrupt it and add a bit of code after its execution which changes it to the colour I want if the automatic colour was chosen (the icon will still show black, but the text will be my colour). I seem to recall being able to interrupt the InsertFootnoteNow function in Word VBA, is something similar possible with Excel?

If this doesn't work, my next plan is to hide the home tab, recreate it completely in the CustomUI tool and point the colour picker to a different macro, but that seems like overkill, and I don't know if the home tab is completely reproducible.

I'm interested in answers to my specific question (how to hijack a function call from the ribbon) as well as other solutions to my problem regarding the automatic font colour. This is meant to be used by other people (in particular ones who are used to using the automatic font colour) so it's not as easy as just creating another button or telling people to use the specific theme colour. But also, knowing how to hijack the function call would also be useful to know.

Cheers
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Couldn't you change the font colour of the Normal style?
 
Upvote 0
Couldn't you change the font colour of the Normal style?
The normal style is already the right colour. In practice the problem is not to get something that works, but to make it intuitive for users who haven't gone through specific training. An untrained user will often think that what they want to do is change the colour of the text, go to the font colour picker and select the large, eye catching option (with a name that sort of implies "default") and end up with a different colour to the one in the rest of the document.

I'm actually more interested in solving the equivalent problem in Word (where "remove formatting" is a less commonly used function), but I reckon the solution will be the same in both applications.
 
Upvote 0

Forum statistics

Threads
1,214,914
Messages
6,122,211
Members
449,074
Latest member
cancansova

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