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: 2
Default Problem with setting chart size in VB.NET

Hello everyone,

I am using VB.NET to automate the create of Excel files. The file that
I am creating has many charts in it. I am having a problem setting the
chart size. I am trying to do this with ChartArea.width. The problem is
everytime I even refer to ChartArea.width (or anything having to do
with ChartArea) the program crashes and gives me the error:

An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in CSTXL.exe

Additional information: Exception from HRESULT: 0x800401A8.


What does this error even mean and what can I do about it?

Here is how I am creating the chart:

oResizeRange = oWS.Range(RangeString)

oChart = oWS.Parent.Charts.Add
With oChart
.ChartWizard(oResizeRange, Excel.XlChartType.xl3DColumn, ,
Excel.XlRowCol.xlColumns)
oSeries = .SeriesCollection(1)
oSeries.XValues = oWS.Range(xValueStart, xValueEnd)
.SeriesCollection(1).Name = ChartName
.Location(Excel.XlChartLocation.xlLocationAsObject ,
oWS.Name)
.ChartArea.Width = 100 '<--------------- CRASH

End With

Thanks

 
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
Weird chart window size problem in XL07 Bobby Charts and Charting in Excel 0 April 13th 09 02:17 PM
Title Block in Excel Chart - Size problem Stuart Saich Charts and Charting in Excel 1 October 25th 05 11:44 AM
Problem setting font size Edward Ulle Excel Programming 2 March 3rd 05 03:23 PM
export chart - size problem Art Parra Charts and Charting in Excel 1 December 7th 04 01:58 AM
setting a chart size julio Excel Programming 1 December 18th 03 05:26 PM


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