views:

513

answers:

1

I have written a program in C# whereby it automatically generates a graph for me from a CSV file and puts it onto a new XLS file. However, I need to change the color of the Line (as it is a Line Chart) to red rather than the default blue.

I am finding this extremely difficult to do and the stuff I've found online has not worked. Please can someone tell me how to do this?

A: 

Most of these type of problems come from not being able to find the exact object and property that needs to be changed.

A sure way to get to this information is to open your Excel file and go to the line chart. Start recording a macro, then change the item that you want to change. Stop recording the macro, and look at the code it generated. This will give you the exact object and property that must be used.

You can then make sure that your C# code is using the correct object and property syntax.

Stewbob