after creating chart -> type mismatch error
Hi,
I'm generating a rather lengthy report in Excel with a lot of sections, drawing on data from Access. For each "section", for various sets of data, I need to generate a chart. So far I have been successful in generating the basics of the chart I want. The problem I am facing is this:
Since the charts are to be generated in a loop (one set of data is reported to excel -> chart created on that data -> loop back and next set of data is reported to excel -> chart created on this second set of data -> and so on), after the first chart is created, I am not able to reference ANY range object in my worksheet. If I comment out the generating of the chart (and do just the data reporting), the code works fine, so I know the syntax is okay. But if I ask the chart to be generated, the next instance of any code such as MySheet.Cells(...) or MySheet.Range(...) or MySheet.Rows(...) or MySheet.Columns(...) gives me a type mismatch error.
I'm sure it's a tiny piece of code I need to fix, or put it in, to return control to the "surface" of the worksheet, but I'm not able to figure it out.
Please help!
Thank you very much,
Kriti
|