Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default User-defined chart type deployment

Jeff -

Here's how to distribute those custom chart types.

Embed each custom chart template on its own worksheet. Put the name for
this chart type in cell A1 of the sheet, and the description in cell A2.

Put this macro into a regular code module in the workbook containing
your custom chart templates:

Sub DistributeChartTypes()
Dim ws As Worksheet
Dim cht As Chart
Dim chto As ChartObject
For Each ws In ActiveWorkbook.Worksheets
If ws.ChartObjects.Count 0 Then
If Len(ws.Cells(1, 1).Value) 1 Then
Set cht = ws.ChartObjects(1).Chart
Application.AddChartAutoFormat Chart:=cht, _
Name:=ws.Cells(1, 1).Value, _
Description:=ws.Cells(2, 1)
End If
End If
Next
End Sub

Finally, put this macro into the "ThisWorkbook" code module of the
workbook with the custom charts:

Private Sub Workbook_Open()
DistributeChartTypes
End Sub

Send out the file with instructions to open it with macros enabled. The
Workbook_Open procedure will run when the workbook opens, which runs the
DistributeChartTypes procedure. If any chart types with the same name
is present, the new one will overwrite the existing one.

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


Jeff K wrote:

In Excel 2002, under XP professional, I have an application that uses
custom chart types (User-defined) stored in the xlusrgal.xls file. I
would like the application to use this file, but I do not want to
overwrite any existing custom chart types. I want the application to
use my xlusrgal only when the application needs it and leave any
other xlusrgal file alone. In prior versions of Excel, I was able to
accomplish by setting/resetting the alt startup path after program
initiation and storing the xlusrgal file there. This does not seem
to work anymore. Any workarounds? (Thanks in advance.)


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
Cant delete user defined default chart type jenalee Charts and Charting in Excel 7 August 21st 09 08:00 PM
Setting up a Custom type, User-defined, Default Chart Kurt Charts and Charting in Excel 0 December 22nd 05 07:43 PM
"User-defined type not defined" message in Excel RW1946 Excel Discussion (Misc queries) 0 August 31st 05 12:14 PM
User defined data type augustus108 Excel Programming 1 April 10th 04 05:11 PM
Word.Document - user defined type not defined jowatkins[_7_] Excel Programming 0 January 20th 04 08:46 AM


All times are GMT +1. The time now is 10:23 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"