VBA Excel - activate Theme when adding new workbook (file -> new)

jdjehanneman

New Member
Joined
Mar 23, 2021
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have added book.xltx in the xlstartup folder with the theme I want by default to be activated when opening a workbook.
This works fine but not when I open a new workbook (File->New). The new empty workbook I open doesn't have the desired default Theme activated.
I have a made an add-in toolbox which is in production for 100 users. The toolbox needs the Theme to be active at all times.

Does anyone have a solution for this?
I tried Auto Open but that doesn't solve the problem.

VBA Code:
Private Sub Auto_Open()
    str_themepath = Application.StartupPath & "\book.xltx"
    ActiveWorkbook.ApplyTheme (str_themepath)
    'MsgBox ("Hello World!")
End Sub

Thanks in front!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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