+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    02-20-2010
    Location
    seattle, wa, usa
    MS-Off Ver
    Excel 2003
    Posts
    2

    type mismatch with chart data load

    Far as I can tell this approach is almost exactly the same as a previous project that had no problem! I can't figure out why I get a 'Type Mismatch' error when the chart tries to load.
    (I know there are other ways, but I'd rather figure out why this is broken

    thanks!


    Code:
        'grab I vs V data
        Worksheets(2).Activate
        Set badd = Range(Cells(step2begin, 7), Cells(step2end, 7))
        Set blob = Union(badd, Range(Cells(step2begin, 8), Cells(step2end, 8)))
        Worksheets(3).ChartObjects(1).Chart.SetSourceData Source:=blob, PlotBy:=xlColumns

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: type mismatch with chart data load

    Which line errors?
    What are the values of your variables when it errors?

    Can you post example
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-20-2010
    Location
    seattle, wa, usa
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: type mismatch with chart data load

    Hi Andy.
    It faults on the last line where I try to set the source data for the chart. step2begin is about 11, step2end is about 1000. I did a select method with the blob range and it selects a perfectly valid block of data, ie if I preselect the same block and insert an XY chart, the data plots ok by default.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: type mismatch with chart data load

    Does the range contain values?
    Cheers
    Andy
    www.andypope.info

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.2.0