matafokka / ExcelDarkThemeFix

Fixes Microsoft Excel appearance when custom Windows theme is used
GNU Lesser General Public License v2.1
127 stars 10 forks source link

Only works on English version of Excel #8

Closed Daeronicus closed 2 years ago

Daeronicus commented 2 years ago

OK, I am aware this is not a bug per se, but as a non English user I was expecting this to happen. This is easily fixed changing the path to microsoft add-ons for the localized version.

In my case, as a spanish user, the path look like this.

PathToWhiteBackground = Environ("AppData") & "\Microsoft\Complementos\ExcelDarkThemeFixBG\whitebg.png" '

You may consider using some sort of validation to detect a localized version of Excel and this way apply the correct path so this patch works well at the start.

matafokka commented 2 years ago

Hello, thanks for reporting this issue! Please, try replacing original .xlam file with the following file (change .zip to .xlam, GitHub won't let me upload otherwise):

ExcelDarkThemeFix.zip

If it works, I'll release an update right away.

matafokka commented 2 years ago

Hello again, @Daeronicus, I just pushed the changes in the file I've sent you. Hopefully, it fixed your issue. It didn't break the installation at least. However, I'm still waiting for your feedback, and if problem still persist, feel free to reopen this issue.

Daeronicus commented 2 years ago

Hello again, @Daeronicus, I just pushed the changes in the file I've sent you. Hopefully, it fixed your issue. It didn't break the installation at least. However, I'm still waiting for your feedback, and if problem still persist, feel free to reopen this issue.

Hi, sorry for the late reply. I have tested your last fix but it doesn't work for me. I will keep using the first release with the localized path to add-ons instead.

matafokka commented 2 years ago

Hey, @Daeronicus, thanks for the feedback!

It's strange that the fix didn't work.

A dumb question just to completely clarify things: are you trying to install using the "hard way" in the instructions?

May I also ask you to:

  1. Open "Developers Tools" tab and click "Visual Basic" button.

image

  1. Double-click on "ThisWorkbook" item in the menu (3 on the screenshot below).
  2. Paste this code (4 on the screenshot below):
Sub test()
    MsgBox (Application.UserLibraryPath)
End Sub
  1. Click on the triangle button (5 on the screenshot below).
  2. Post the path that will be displayed in the opened window. A screenshot is fine too.

image

Also, please, try to manually create %AppData%\Microsoft\AddIns folder and put ExcelDarkThemeFix files here.

Notes for possible future reference:

MS docs says that Application.UserLibraryPath "returns the path to the location on the user's computer where the COM add-ins are installed".

In my system the path is correct: C:\Users\matafokka\AppData\Roaming\Microsoft\AddIns\.

I haven't found any information on localized paths, so I'm guessing that either:

  1. I'm missing something.
  2. MS forgot to make Application.UserLibraryPath return the localized value.
  3. MS forgot to create AddIns folder in non-English versions of Excel. Also, why they're creating a localized folder then?
matafokka commented 2 years ago

Hi, finally got time to look again into your issue. Tested on non-English Office build, everything works fine, the returned path is correct.

So I'm sorry but I can't fix what I can't reproduce. Still, further reports and suggestions will be appreciated.

Daeronicus commented 2 years ago

Hey, @Daeronicus, thanks for the feedback!

It's strange that the fix didn't work.

A dumb question just to completely clarify things: are you trying to install using the "hard way" in the instructions?

May I also ask you to:

1. Open "Developers Tools" tab and click "Visual Basic" button.

image

2. Double-click on "ThisWorkbook" item in the menu (3 on the screenshot below).

3. Paste this code  (4 on the screenshot below):
Sub test()
    MsgBox (Application.UserLibraryPath)
End Sub
4. Click on the triangle button (5 on the screenshot below).

5. Post the path that will be displayed in the opened window. A screenshot is fine too.

image

Also, please, try to manually create %AppData%\Microsoft\AddIns folder and put ExcelDarkThemeFix files here.

Notes for possible future reference:

MS docs says that Application.UserLibraryPath "returns the path to the location on the user's computer where the COM add-ins are installed".

In my system the path is correct: C:\Users\matafokka\AppData\Roaming\Microsoft\AddIns\.

I haven't found any information on localized paths, so I'm guessing that either:

1. I'm missing something.

2. MS forgot to make Application.UserLibraryPath return the localized value.

3. MS forgot to create `AddIns` folder in non-English versions of Excel. Also, why they're creating a localized folder then?

Yes, I have installed this using the "hard way" and the path returned is this: imagen

It is the path I posted earlier when I post this issue. I have no clue if this is something with the Spanish version of Office ( I am using Office 365) or this is happening with another language. I have created the AddIns folder and pasted the fix there, as default office will not detect the addin in that folder so I have to go find the xlam file, doing so will not work either. The only way I have found this fix work on my end is using your first release and changing the AddIns folder for my localized version on the path variable.

Daeronicus commented 2 years ago

Hi, finally got time to look again into your issue. Tested on non-English Office build, everything works fine, the returned path is correct.

So I'm sorry but I can't fix what I can't reproduce. Still, further reports and suggestions will be appreciated.

Don´t worry and thanks for your efforts. This fix still works for me even if is not the way you intended.

matafokka commented 2 years ago

I am using Office 365

Ah, that's gotta be the case! Previously there also was a report that my Add-In doesn't work as intended. Unfortunately, I have no option to buy 365, so there's no official support.

Have you encountered any other issues with it?

I'll also update readme right now, this is a great find!

Don´t worry and thanks for your efforts. This fix still works for me even if is not the way you intended.

Thanks, glad it still worked :)

Daeronicus commented 2 years ago

Have you encountered any other issues with it?

No, I haven´t. I use office 365 at work and 2019 at home so with the little change to the addins path your fix work just fine. I mostly use dark themes on both of my systems so this comes very handy.

matafokka commented 2 years ago

That's nice to hear. I hope they fixed VBA in 365. I'm still leaving the notice in the readme though.