Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default determine current theme in xl2007

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   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default determine current theme in xl2007

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default determine current theme in xl2007

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function to determine current cursor position? Dan Excel Worksheet Functions 1 March 12th 09 02:56 PM
How to determine the current position of an open .xls file? Andrew Excel Programming 3 March 20th 07 10:09 PM
How to determine whether Cell is in current view? Joe HM Excel Programming 2 April 6th 06 10:12 PM
Find cell and determine value in current row Kathy - Lovullo Excel Programming 1 December 28th 04 02:13 PM
Determine current default fill color Steve Conary Excel Programming 0 December 2nd 04 05:08 PM


All times are GMT +1. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"