Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to determine the current file being used as the theme in xl2007.
I know you can load different themes by using (watch line break) ActiveWorkbook.Theme.ThemeColorScheme.Load ( _ "C:\Program Files\Microsoft Office\Document Themes 12\Theme Colors\Equity.xml") But I can't figure out how to get it to tell me which file it is currently using. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry for this, but I just discovered something else that I need answered.
If you record a macro to change the theme away from the default then change it back to the "office" theme you get an unusable bit of code" ActiveWorkbook.Theme.ThemeColorScheme.Load () this gives you a runtime error. Also, if you look in the directory listed below, there is no xml file for the default theme. If this is the case, how can I switch back to the default theme programmatically? "JNW" wrote: Is there a way to determine the current file being used as the theme in xl2007. I know you can load different themes by using (watch line break) ActiveWorkbook.Theme.ThemeColorScheme.Load ( _ "C:\Program Files\Microsoft Office\Document Themes 12\Theme Colors\Equity.xml") But I can't figure out how to get it to tell me which file it is currently using. Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have found a way around the 2nd of your problems, that of changing back to
the Office theme, although it is a bit roundabout! You need to first save the Office theme to a 'thmx' file by using any workbook that has this Office theme applied, where you use the Themes dropdown and then the 'Save Current Theme' option to create this file. You can then just use the ApplyTheme method of a Workbook using this 'thmx' file, which will change back to the Office theme. Of course this does mean that you need to have this file on any PC that you wish to use the VBA code! For any component of the Theme, for example Colours, you just need to create the Office Theme version of the XML file, where the details can easily be obtained from the Office thmx file that you have just created, or using the Save method of the individual Theme Component in VBA, where you can then just use the Load method to change just this component of the theme programmatically. I can find no easy alternative, as I also get the error message when trying to use the Recorded Macro code. I can't help you on the first problem of determining what the current theme is! Other than to suggest that you could look inside the xlsx file and locate the Theme xml file inside this container, and then checking the Name attached to the Colour, Font and Effects elements. Hope this helps, and is not too late to be of any use! Rob "JNW" wrote: Sorry for this, but I just discovered something else that I need answered. If you record a macro to change the theme away from the default then change it back to the "office" theme you get an unusable bit of code" ActiveWorkbook.Theme.ThemeColorScheme.Load () this gives you a runtime error. Also, if you look in the directory listed below, there is no xml file for the default theme. If this is the case, how can I switch back to the default theme programmatically? "JNW" wrote: Is there a way to determine the current file being used as the theme in xl2007. I know you can load different themes by using (watch line break) ActiveWorkbook.Theme.ThemeColorScheme.Load ( _ "C:\Program Files\Microsoft Office\Document Themes 12\Theme Colors\Equity.xml") But I can't figure out how to get it to tell me which file it is currently using. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Function to determine current cursor position? | Excel Worksheet Functions | |||
How to determine the current position of an open .xls file? | Excel Programming | |||
How to determine whether Cell is in current view? | Excel Programming | |||
Find cell and determine value in current row | Excel Programming | |||
Determine current default fill color | Excel Programming |