Greetings. I've been having a problem with my Excel macro that I've built to automatically create charts. I have a rather large spreadsheet that has all kinds of data in it. When I select a cell and run my macro, the code finds the previous 6 cells for that row and then dynamically creates a chart.
My code works great on my test data. When I tried on my live data, I started getting a strange error (sometimes).
On some of the data that I attempt to create a chart, I get a "type mismatch" error when I use the statement:
Again I only get this error "sometimes".
The really strange thing is that when I add a blank row anywhere into the worksheet, and then I run the macro again against the same data it works fine.
Has anyone experienced this problem before? Is Excel doing something behind the scenes that I'm not aware of?
Thanks in advance for you help.
(txmed)
My code works great on my test data. When I tried on my live data, I started getting a strange error (sometimes).
On some of the data that I attempt to create a chart, I get a "type mismatch" error when I use the statement:
Code:
Dim pobjChart As New Chart
Set pobjChart = Charts.Add
Again I only get this error "sometimes".
The really strange thing is that when I add a blank row anywhere into the worksheet, and then I run the macro again against the same data it works fine.
Has anyone experienced this problem before? Is Excel doing something behind the scenes that I'm not aware of?
Thanks in advance for you help.
(txmed)