+ Reply to Thread
Results 1 to 2 of 2

[SOLVED] Problem with setting chart size in VB.NET

Hybrid View

  1. #1
    XxLicherxX
    Guest

    [SOLVED] 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


  2. #2
    Registered User
    Join Date
    11-21-2007
    Posts
    1

    Setting chart size

    Hi,

    I have a similar problem with setting the size of the chart. I get the error message 'unable to set the left property of the chart area class'. Just want to check if you managed to find out why this happens or if you have solved this problem? Thanks

    Best regards
    Cliffy Ah Ling

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1