PC Review


Reply
Thread Tools Rate Thread

Access custom chart autoformats

 
 
John Shell
Guest
Posts: n/a
 
      16th Feb 2007
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++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
 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      16th Feb 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++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



 
Reply With Quote
 
John Shell
Guest
Posts: n/a
 
      16th Feb 2007
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"
<(E-Mail Removed)> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code behind AutoFormats - Access 2007 h2fcell Microsoft Access Forms 5 8th May 2009 03:31 PM
Set custom chart type from MS Access 97 to Excel 2000? NoSpamTakeSquareRootOfNumber Microsoft Excel Charting 5 26th Aug 2008 10:15 AM
Adding custom XYscatter labels to Excel Chart from Access VBA dne Microsoft Access VBA Modules 2 12th Sep 2005 07:23 PM
Restore AutoFormats in Access XP =?Utf-8?B?Y2Fubm9ud2lsbA==?= Microsoft Access 1 18th May 2005 10:11 PM
How do I restore deleted Form AutoFormats in Access 2000? =?Utf-8?B?VG9t?= Microsoft Access Forms 1 22nd Nov 2004 09:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:15 PM.