View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.charting
Fredrik E. Nilsen Fredrik E. Nilsen is offline
external usenet poster
 
Posts: 43
Default Control charts through VBA

Hi,

First of all; thanks for all the help I have got from this group
already. I'm still experimenting with controlling charts through VBA.
I'm trying to controll the sizing of the chart object and elements of
the chart and to apply formatting based on user-defined charts in
xlusrgal.xls. This is what I've got so far:

Sub Diagram1()
If Not ActiveChart Is Nothing Then
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
"Linje1"
ActiveWorkbook.Colors = Workbooks("XLUSRGAL.XLS").Colors
With ActiveChart.Parent
.Height = 252.75
.Width = 342.75
End With
With ActiveChart.PlotArea
.Height = 204
.Width = 340
.Top = 20
End With
With ActiveChart.Legend
.Left = 0
.Top = 250
End With
Else
MsgBox "Du må merke et diagram før du utfører denne
handlingen.", _
vbExclamation, "Ingen diagram merket"
End If
End Sub

I must admit that I don't understand all of the syntax and I guess
that there are better ways to accomplish this?

--
Fredrik E. Nilsen