LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Anchoring a chart to a certain area


I have an application that I use WinForms.net and VB.NET as the
frontend, MS Access 2000 as the backend. I use Excel to create reports.
On the biggest report I I have tables and charts.

I create the charts in the spreadsheet as an object. However, when the
chart is created it is not put where I would like to be. I have tried
to select a cell prior to creating the chart but this only puts it in
the general area.

Here is the code that I use to create the chart:

xlSheet.Cells(((nChartOffset) + 9) + i, 1).Select()
'this puts the chart in the general area
Dim oChart As Excel.Chart
Dim xlsAxisCategory, xlsAxisValue As Excel.Axes

oChart = xlSheet.Application.Charts.Add
Dim xlsSerie As Excel.SeriesCollection =
oChart.SeriesCollection
oChart.ChartType = Excel.XlChartType.xlLine
oChart.SetSourceData(Source:=xlSheet.Range("M" &
(nChartOffset) + 13 & ":N" & ((nChartOffset) + 13) + i),
Plotby:=Excel.Constants.xlColumn)

oChart.Location(Excel.XlChartLocation.xlLocationAs Object, "Quarterly
Portfolio Review")
'oChart.ChartArea.Height = 150
'oChart.ChartArea.Width = 300
'oChart.HasTitle = True
'oChart.ChartTitle.Text = "ASSET GROWTH SINCE
INCEPTION"
'oChart.ChartTitle.Font.FontStyle = "Bold"
'oChart.ChartTitle.Font.Size = 9.75
'oChart.SeriesCollection = xlSheet.Range("M" & (nrow *
26) + 13 & ":M" & ((nrow * 26) + 13) + i))
'xlsSerie.Item(1).Name = "Market Value"
'xlsSerie.Item(2).Name = "Net Cash Flow"

How can I accomplish this?

BTW, all of the code that is commented out causes an error.

I get an error on the first commented line above that states:

"Exception from HRESULT: 0x800401A8."

Each of the commented lines cause the same error.

I don't know what this error means. I can not find anything that helps
on the internet.


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

 
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
Stacked area and area chart combo [email protected] Charts and Charting in Excel 6 August 18th 06 02:30 PM
Resize plot area in a chart area Darlene Excel Discussion (Misc queries) 0 July 10th 06 02:50 PM
How to increase chart area without affecting plot area? [email protected] Charts and Charting in Excel 2 April 21st 06 09:05 PM
Resize chart area without resizing plot area Janwillem van Dijk Charts and Charting in Excel 2 August 2nd 05 01:52 AM
Resize chart area without resizing plot area Janwillem van Dijk[_2_] Excel Programming 2 August 2nd 05 01:52 AM


All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"