Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Access custom chart autoformats

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++Hello,
I want to access the available user-defined chart formats. I will
present the names of the formats to the user in a list for him/her to
choose one.

I found a post here that provided sample code that loaded the
xlusrgal.xls file (where the user-defined formats are stored) into a
workbook, then iterates through the charts in that workbook. This
works fine except that the contents of the file briefly flash onto the
screen until I can set it invisible. Is there any other way of
accessing the names of the format or of loading the file without it
flashing on the screen? There are methods available for adding and
deleting formats, I would think there should be methods/properties for
iterating through the formats.

Below is the code I have for loading and going through the xlusrgal
file (just adding the names to a string instead of a listbox for now).

strUsrGalFile = Application.UserLibraryPath & _
"..\Excel\XLUSRGAL.XLS"
If (Dir(strUsrGalFile) < "") Then
Workbooks.Open strUsrGalFile, ReadOnly:=True
With Workbooks("xlusrgal.xls")
.Windows(1).Visible = False
For i = 1 To .Charts.Count
strUsrFormats = strUsrFormats & .Charts(i).Name & _
vbNewLine
Next i
MsgBox .Charts.Count & " charts" & vbNewLine & _
strUsrFormats
.Close False
End With
End If


Thanks much,
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Access custom chart autoformats

To avoid flashing:

Application.ScreenUpdating = False
Workbooks.Open strUsrGalFile, ReadOnly:=True
Application.ScreenUpdating = False

You can only delete or apply formats if you know their names ahead of time.
I don't think you can access the user defined chart types without opening
the user gallery workbook.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"John Shell" wrote in message
...
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++Hello,
I want to access the available user-defined chart formats. I will
present the names of the formats to the user in a list for him/her to
choose one.

I found a post here that provided sample code that loaded the
xlusrgal.xls file (where the user-defined formats are stored) into a
workbook, then iterates through the charts in that workbook. This
works fine except that the contents of the file briefly flash onto the
screen until I can set it invisible. Is there any other way of
accessing the names of the format or of loading the file without it
flashing on the screen? There are methods available for adding and
deleting formats, I would think there should be methods/properties for
iterating through the formats.

Below is the code I have for loading and going through the xlusrgal
file (just adding the names to a string instead of a listbox for now).

strUsrGalFile = Application.UserLibraryPath & _
"..\Excel\XLUSRGAL.XLS"
If (Dir(strUsrGalFile) < "") Then
Workbooks.Open strUsrGalFile, ReadOnly:=True
With Workbooks("xlusrgal.xls")
.Windows(1).Visible = False
For i = 1 To .Charts.Count
strUsrFormats = strUsrFormats & .Charts(i).Name & _
vbNewLine
Next i
MsgBox .Charts.Count & " charts" & vbNewLine & _
strUsrFormats
.Close False
End With
End If


Thanks much,
John



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Access custom chart autoformats

Thanks a lot, Jon. I thought I looked through all of the properties
and methods of Application, but somehow managed to miss that one.
Excel VBA isn't exactly my forte (I'm mainly a C++ person), so the
help is greatly appreciated.

John Shell

On Fri, 16 Feb 2007 13:06:21 -0500, "Jon Peltier"
wrote:

To avoid flashing:

Application.ScreenUpdating = False
Workbooks.Open strUsrGalFile, ReadOnly:=True
Application.ScreenUpdating = False

You can only delete or apply formats if you know their names ahead of time.
I don't think you can access the user defined chart types without opening
the user gallery workbook.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______

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
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Charts and Charting in Excel 2 March 6th 09 04:43 PM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Setting up and Configuration of Excel 1 March 6th 09 01:57 AM
How do I color code a Pivot Table - not standard Autoformats? minks Excel Discussion (Misc queries) 2 March 7th 07 01:01 PM
Autoformats in Excel 2002 Gary Settery New Users to Excel 1 December 10th 04 10:29 PM
Excel2002 autoformats dates, Bob Excel Programming 0 April 21st 04 05:51 PM


All times are GMT +1. The time now is 11:20 AM.

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

About Us

"It's about Microsoft Excel"