The examples do actually give you a good approach to see how in CVI things are done with ActiveX. Then the Excel documentation shows you how to do it things specifically with Excel. From Excel's documentation, you can find out that to do this you need to:
1) From the chart, get the series object from the chart that you want to work with. This is done with the SeriesCollection function on the Chart object.
2) Get the property of the Series called Border which controls line styles.
3) Change the properties of the Border object to change the plot characteristics.
From the CVI examples, you can see that to call a method on a object I need a handle to the object and I need to find the function in the Excel ActiveX controller driver. In
this case, step one would look like:
Excel_ChartSeriesCollection (hChart, NULL, CA_VariantInt(1),&hSeries);
where hChart is the object handle to the chart that you want to work with, and hSeries is the handle to first series (index 1) in that chart. Next, in CVI to get a property of the series for step 2, you use the GetProperty function. We want to get the Border property which would look like this:
Excel_GetProperty (hSeries, NULL, Excel_SeriesBorder, CAVT_OBJHANDLE, &hBorder);
where hBorder is the handle to the Border Object. Now you are ready to set properties like line color and style. You would use the SetProperty function and set any of the Border object properties. For example, to set line color, something like:
Excel_SetProperty (hBorder, NULL, Excel_BorderColor, CAVT_VARIANT, VariantColorVal);
where VariantColorVal is a VARIANT that holds the color data. Help for the values to be used with color will be in the Excel documentation.
Hope that helps.
Best Regards,
Chris Matthews
National Instruments