Catching Excel message windows when creating ChartObject in C#

M

mchelm

Need help with this one. Would be very grateful.

In C# program, I create a ChartObject:

((Excel.ChartObjects)_ws.ChartObjects(mv)).Add(400, 400, 400, 400);

When the above line is executed, I receive a message from Excel telling me
something to the effect that "The maximum number of data points you can use
in a data series for a 2-D chart is 32,000. If you want to use more than
32,000 data points, you must create two or more series."

What can I do to manage these information windows? I tried exception
handling here, but this window is not caught.

Running this program on Excel 2003 is not a problem. This only occurs when
I am running this program against Excel 2007.

Thanks very much.

matthew
 
N

Norman Yuan

You can try to set Excel.Application.DisplayAlerts=False. It may or may not
surpress the alerting message you run into, but worth a try.
 

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