S
Stumped
Hi,
My VB program uses Excel's built in custom type chart
called Smooth Lines. I use the following code to call it:
Excel.ActiveChart.ApplyCustomType ChartType:=xlBuiltIn,
TypeName:="Smooth Lines"
This works fine in an English version Excel but when you
have a German Excel it causes an error and says that the
type name is not applicable. The reason for this is
because the German version of Excel calls the Smooth
Lines as Weiche Linien and if I replace the Smooth Lines
type name with Weiche Linien, it works.
The only solution I could come up with are either:
1. Create my chart with all the properties of Smooth
Lines chart. The chart I created has all the properties
of Smooth Lines except the width is a little off. This is
basically what I have in my VB program:
With .ActiveChart
.ChartType = xlLine
.BarShape = xlBox
.DepthPercent = 100
.DisplayBlanksAs = xlNotPlotted
.GapDepth = 150
.HasDataTable = False
.HasLegend = True
.HasPivotFields = False
.HasTitle = False
.PlotVisibleOnly = True
.PlotBy = xlRows
.ProtectData = False
.ProtectFormatting = False
.ProtectGoalSeek = False
.ProtectSelection = False
.SizeWithWindow = False
.Visible = xlSheetVisible
.WallsAndGridlines2D = False
End With
With .ActiveChart.Axes(xlValue)
If .HasMajorGridlines Then
.MajorGridlines.Border.ColorIndex = 2
End If
End With
.ActiveChart.Axes(xlCategory).CategoryType =
xlCategoryScale
.ActiveChart.Axes
(xlCategory).AxisBetweenCategories = False
This is not a bad alternative to me but a little
complicated. If I want to use another built in custom
type, I would have to find out all the properties and
compare the physical attributes to my new chart.
2. The second alternative is to open the Smooth Lines
chart and save is as a user defined chart (xlusrgal.xls)
but this will overwrite the user's existing xlusrgal.xls
file and I don't want to do that.
Does anyone have any suggestions on this? Thank you very
much!!
My VB program uses Excel's built in custom type chart
called Smooth Lines. I use the following code to call it:
Excel.ActiveChart.ApplyCustomType ChartType:=xlBuiltIn,
TypeName:="Smooth Lines"
This works fine in an English version Excel but when you
have a German Excel it causes an error and says that the
type name is not applicable. The reason for this is
because the German version of Excel calls the Smooth
Lines as Weiche Linien and if I replace the Smooth Lines
type name with Weiche Linien, it works.
The only solution I could come up with are either:
1. Create my chart with all the properties of Smooth
Lines chart. The chart I created has all the properties
of Smooth Lines except the width is a little off. This is
basically what I have in my VB program:
With .ActiveChart
.ChartType = xlLine
.BarShape = xlBox
.DepthPercent = 100
.DisplayBlanksAs = xlNotPlotted
.GapDepth = 150
.HasDataTable = False
.HasLegend = True
.HasPivotFields = False
.HasTitle = False
.PlotVisibleOnly = True
.PlotBy = xlRows
.ProtectData = False
.ProtectFormatting = False
.ProtectGoalSeek = False
.ProtectSelection = False
.SizeWithWindow = False
.Visible = xlSheetVisible
.WallsAndGridlines2D = False
End With
With .ActiveChart.Axes(xlValue)
If .HasMajorGridlines Then
.MajorGridlines.Border.ColorIndex = 2
End If
End With
.ActiveChart.Axes(xlCategory).CategoryType =
xlCategoryScale
.ActiveChart.Axes
(xlCategory).AxisBetweenCategories = False
This is not a bad alternative to me but a little
complicated. If I want to use another built in custom
type, I would have to find out all the properties and
compare the physical attributes to my new chart.
2. The second alternative is to open the Smooth Lines
chart and save is as a user defined chart (xlusrgal.xls)
but this will overwrite the user's existing xlusrgal.xls
file and I don't want to do that.
Does anyone have any suggestions on this? Thank you very
much!!