View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
enak[_4_] enak[_4_] is offline
external usenet poster
 
Posts: 1
Default Anchoring a chart to a certain area


Thanks for the reply. That fixed that problem. I need to be able to
format the chart, i.e. set the x axis, set the legend, put in data
points along the lines of the chart, etc.

Here is what I have so far:

'Anchore the chart to a particular area.
With xlSheet.Range("A" & nChartOffset + 5 & ":E" &
nChartOffset + 15)
xlSheet.ChartObjects.Add(.Left, .Top, .Width,
..Height)
nChartObj += 1
End With

oChartObj = xlSheet.ChartObjects(nChartObj)
oChart = oChartObj.Chart
oChart.ChartType = Excel.XlChartType.xlLine
oChart.SetSourceData(Source:=xlSheet.Range("M" &
nChartOffset + 13 & ":N" & ((nChartOffset) + 13) + i),
Plotby:=Excel.Constants.xlColumn)
'Dim xlsSerie As Excel.SeriesCollection =
oChart.SeriesCollection(1)

oChart.Location(Excel.XlChartLocation.xlLocationAs Object, "Quarterly
Portfolio Review")
oChartObj.Width = 250
oChartObj.Height = 175

Everything that I have tried has given me an error. I have looked
through the chartobject but do not see what I need. How can I do this?

Thanks,
enak


--
enak
------------------------------------------------------------------------
enak's Profile: http://www.excelforum.com/member.php...o&userid=28650
View this thread: http://www.excelforum.com/showthread...hreadid=483152