Memory Leak when copying charts to another worksheet

C

Claus Zimmermann

Hi

I have a BAD memory leak when I copy a chart... even a blank chart to
another worksheet. It eventually causes excel to crash.

In my example, the sequence to crash excel was as follows:
- Copy Chart 5000 times (loop) - less times would work too, and you'd
see the increase in private bytes as you go along
- Copy method of range class failed
- Clicked End button on debug message box
- Closed Excel
- Message: The picture is too large and will be truncated
- Excel.exe - Application error. The instruction at "0x300dc756"
referenced memory at "0x000000008". The memory could not be read.

I'm using Excel 2000 sp3

- Have turned off font scaling,
- Do not use the clipboard for copying
- Text works fine, pictures work fine, but not charts

I also read a MS Knowledge Base Article 264986 for XL97 which said there was
an error in copying worksheets containing charts. But does it pertain to
XL2000?

In in my actual application, I add a set amount of graphs, copy the
worksheet to another workbook, and then I destroy the worksheet. Same
problem


To test memory I'm using perfmon, and am testing private bytes in Excel.

Any suggestions or a workaround?

Sample macro available illustrating this on request.

Claus
 
C

Claus Zimmermann

Thanks routeram for your information

I've manually set my fontscaling to false, and it makes a difference, but
the problem is still there.

I managed to create graphs using the chart object, but there is still a
leak.

My final goal is to copy the graph onto an new worksheet, and when I try
this, there is still a worksheet.

There is good news however! I have found that copying a chart as a picture
onto the new worksheet, and then saving it does not cause ANY leakage :) I
suppose I will go with this solution for now, though it would be great to
fix it properly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top