LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using ActiveX to change line weight

Solved!
Go to solution

Hey, I'm looking to change the line weight using ActiveX and invoke nodes in some excel charts that I have created. Each chart is in its own 'sheet' and each chart has 3 series. I only want to change the line weight on a specific chart and specific series. I understand the basic structure of using the invoke node after looking at examples, but I was wondering if it was possible to edit specific charts and specific series and how to go about doing so. From the examples I've seen it looks like for the most part they apply the changes to all series...any help is appreciated, thank you!

0 Kudos
Message 1 of 10
(3,521 Views)

How far have you got in your code so far and can you post it?

 

Can you open Excel?  Can you open the document?  Can you switch to the correct sheet?  Can you find the chart on the sheet you need to alter?  Can you get the properties of that chart?

0 Kudos
Message 2 of 10
(3,488 Views)

Heres what I have so far. Capture 1 is how I handle all the charts basic formating such as size titles and labels...Capture 2 is an attempt to access specific charts and series within the workbook.

Download All
0 Kudos
Message 3 of 10
(3,484 Views)

I think that since you have 2 series, instead of getting a "Series" object back you're getting a "SeriesCollection" instead, so the variant casting there doesn't work properly.  You can either try casting to a SeriesCollection instead of that and using the "Item" method with the correct Index input to get the Series object, or just wire an index to the SeriesCollection method in the first place.

 

And also as a general note, writing to the same property of an object within the same property node is generally not going to accomplish anything, as the first is immediately replaced by the second:

 

Doubled property node.PNG

 

 

Message 4 of 10
(3,458 Views)

Alright I'll try that out, thank you for your time!

0 Kudos
Message 5 of 10
(3,450 Views)

I still have one issue though, using these invoke nodes how do I specify what sheet I need to use in addition to specifying which series to make changes to?

0 Kudos
Message 6 of 10
(3,439 Views)

@Zzimmha42 wrote:

I still have one issue though, using these invoke nodes how do I specify what sheet I need to use in addition to specifying which series to make changes to?


How about actually doing work and reading the Microsoft's Excel Developer Reference?

It is available online.

0 Kudos
Message 7 of 10
(3,435 Views)

NYC,

 

I appreciate your condescending attitude, a link would've extra helpful but I'll go check it out. Thank you!

0 Kudos
Message 8 of 10
(3,423 Views)
Solution
Accepted by topic author Zzimmha42

Use the Index variant input to get the Chartsheet you want to modify (idem for the series in the SeriesCollection). The index value can either be numeric (starting at 1 for the first chartsheet in the workbook) or the name of the chartsheet.

 

Excel Developper Reference

 

Ben64

Message 9 of 10
(3,386 Views)

Ben64,

 

Thank you very much for your help and the link. That info about the index was exactly what I needed, very much appreciated.

0 Kudos
Message 10 of 10
(3,345 Views)