J
John Shell
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++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
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