Microsoft Excel background grid color default reverts

  • #1
joshmccraney
Gold Member
2,253
143
Basically, microsoft excel always has white background cells, and I'd like it to be a different color. Here's what I've tried: I configured the below registry value in my Windows 11 user profile to change the default window color from 255 255 255 (i.e. white) to 192 192 192 (i.e. a not so bright on the eyes grey). Excel is much easier on the eyes with this setting (unless a white fill cell shade has been applied). However, after a while, if I close Excel, and re-open Excel, or if my computer sleeps, the colors revert to white despite the number in the registry still reading 192 192 192.

Windows Registry Editor Version 5.00

; reg query "HKEY_CURRENT_USER\Control Panel\Colors" /v Window
; reg add "HKEY_CURRENT_USER\Control Panel\Colors" /v Window /t REG_SZ /d "192 192 192" /f

[HKEY_CURRENT_USER\Control Panel\Colors]
"Window"="192 192 192"

Do you know how to fix this? Seems pointless to have a setting that changes the window colors only to revert/override by another setting.
 

Answers and Replies

  • #2
anorlunda
Staff Emeritus
Insights Author
11,207
8,624
I got this by turning on the High Contrast Windows Setting.

1671749541291.png
 
  • #3
joshmccraney
Gold Member
2,253
143
I got this by turning on the High Contrast Windows Setting.

View attachment 319233
I'm wondering if there's a way without high contrast, and just leaving it in dark mode
 
  • #4
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,954
15,647
Select the whole worksheet. (Click in the top left corner. Right click, go to the Background tab and select the color you want,

How did I find it? Entered "excel set background color" into Google. Sixty-two million hits.
 
  • #5
joshmccraney
Gold Member
2,253
143
Select the whole worksheet. (Click in the top left corner. Right click, go to the Background tab and select the color you want,

How did I find it? Entered "excel set background color" into Google. Sixty-two million hits.
Okay, there’s some sarcasm there for sure. Yes I saw those solutions but they’re dead wrong. They only change CURRENT files, but I have tons that are given to me, past, etc. What I’ve shown above fixes this issue until the computer restarts, or sleeps. A myriad of users face the same issue (recently in 2022) yet no fix has been made. I write here to ask if anyone knows the root of the cause.
 
  • #6
Tom.G
Science Advisor
Gold Member
4,748
3,511
They only change CURRENT files, but I have tons that are given to me, past, etc
Much work, but have you tried re-saving those old spreadsheets after changing their background color?

There is another possibility for batch changes. XLSX files are Zipped XML files. You could unzip a file, read the XML text files to find and change the background color, then zip them all together again. Of course someone may have already written a program for this.

Two programs I've found useful for before/after registry compares are:
InCtrl5
REGSHOT

You run one of the above for a "Before" registry capture
Do the install or run whatever program you are investigating
Run the capture program again and it reports all (or a specified subset) of the registry changes

There is also a program called REGMON that monitors registry accesses and reports them in real time. It was found on one of the Microsoft websites but I haven't looked lately.

All three are very old programs and may be hard to find... Ahh, some time spent Googling was succesful!

InCtrl5 can be found at: (about middle of the page, under Install Tracer)
https://www.hiren.info/downloads/freeware-tools/page/8

The REGSHOT website no longer exists, but the program seems to be available at: https://sourceforge.net/projects/regshot/

Hope it helps,
Tom
 
Last edited:
  • #7
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,954
15,647
They only change CURRENT files, but I have tons that are given to me, past, etc
Well, you might have said that at the beginning rather than getting grumpy about the imperfect mental telepathy of the readers here. For someone who demands a lot of help from PF, your sure don't make it easy. And easy is respectful.

Excel stores cell attributes like color, fonts, etc. with the worksheet. I hope this is obvious - if it didn't, how would it remember them, especially across computers? So if you want to change the file contents, you need to open the file and change its contents. Again, I hope this is obvious.

By far, the easiest solution is to follow Google's advice, and when you open a file to work on it, make the half-dozen clicks to change the color and save it. When you next open it, it will have the new colors.

It is possible to automate the process with a combination of the Automate Tab and Scripts. I strongly recommend against this.,
  • If it takes a few seconds to change the color, and an hour to write and debug the script, breakeven is at about a thousand files. Very, very few people have a thousand spreadsheets they are actively using.
  • The risk of damage is high. If you mess up manually, you might ruin a spreadsheet. If you automate the process you could ruin all of them.
  • When your code has changed the file and opened it, you must, must, must open it and make sure it wasn't broken. That removed any time savings.
Mucking with the registry is almost never the right answer, and it is never the right first step. That would be like wanting to kearb to juggle and starting with chainsaws rather than bean bags. In the case at hand, the absolute best you can hope for is a change of cell background colors that have never been set. That is not what you say you wanted.
 
  • #8
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,954
15,647
XLSX files are Zipped XML files.
I would also not recommend this either. Every argument for not doing this as a batch program inside Excel goes double for doing it outside of Excel. WEill it work? Sure. But I still would not do it this way.
 
  • #9
joshmccraney
Gold Member
2,253
143
Demands a lot? You use the word loosely. How you expect people to reply to sarcasm? The 62 million hits comment was superfluous and kinda rude. Not sure if that's how you meant it but it came off demeaning. If you follow my posts here (your response implies you do), you know I research before posting. The approach you suggest is manual, so when I generate dozens of .csv files a day I'd prefer not having to manually change the background (notepad++ works here, but plotting in there is tough). I did the approach you suggested first, but it gets tedious real quick. The registry approach does work, but fails upon reset. It's odd because the numbers themselves in the registry detailing the color do not change, so something is overriding the registry. Sounds like there's no good solution, or if so no one seems to be aware of it (both on PF and many other sites I've seen). High contrast might be the only approahc... Tom, I'd look into those but this is a work machine, and I can't really install third party apps. Thanks for the suggestion. Appreciate everyone's feedback.
 
  • #10
berkeman
Mentor
64,467
15,846
so when I generate dozens of .csv files a day I'd prefer not having to manually change the background
I haven't read your thread, but instead of creating these with File, New, can you instead use File, Open, Save-As? That way you could have one starter file that has the properties you want, and it gets re-used each time you want to create a new file.
 
  • #11
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,954
15,647
when I generate dozens of .csv files a day
And another requirement slowly leaks out.

You haven't said if you want to keep these in CSV format or you want to save them as XLSX. If the former, there is no concept of "cell", much less "cell color". It won't be saved with the file no matter what you do.

But honestly, if five clicks is too much work, I doubt any recipe for doing this will be satisfactory. (And put another way, you have already spent more time trying to find the better solution than weeks and weeks of five clicks.

creating these with File, New, can you instead use File, Open, Save
Well, one can bring it in via Data/Get Data. But that opens a dialog box that will be more than five clicks. Plus whatever it takes to change the format.
something is overriding the registry
Nothing "overrides" the registry. The registry doesn't do anything. It
is just a database. An easily corruptable database with no guarantee that any given change will do what you want. It's almost never what you want.
"
 

Suggested for: Microsoft Excel background grid color default reverts

  • Last Post
Replies
6
Views
629
Replies
2
Views
388
Replies
10
Views
536
Replies
4
Views
1K
Replies
5
Views
1K
  • Last Post
Replies
16
Views
1K
  • Last Post
Replies
2
Views
660
Replies
1
Views
606
Replies
3
Views
487
Replies
5
Views
625
Top