From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel Active X properties and methods issue.

Solved!
Go to solution

Hello all,

 

I have a project that creates an excel workbook, writes data to it, then creates charts from this data. The charts have custom textboxes that I add using properties and methods (Attached below). I am running into an issue where not all of the textboxes have been appearing (examples also attached). I just recently replaced the computer at my test station with a windows 10 machine. All excel settings are the same. Am wondering if anyone has run into this before or have any indications as to the issue. I have had trouble finding resources to the specificity of the issue. Thank you!

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

Anytime you have a piece of code that is reused multiple times, put it in a VI (this is similar to a function in C) and pass in the values that change (i.e. the textbox location and the text value/font size). This will simplify your code greatly and code changes will be much easier. 

 

Now for your question, I'll answer it with another question.  Are the textboxes in the workbook, only hidden behind the graph?  You may need to specify a z-order value for the text box.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 10
(3,328 Views)

I agree with aputman, probably a z-order issue. You can use the ZOrder method of the Shape object to move it to the front.

 

Ben64

Message 3 of 10
(3,296 Views)

Thank you guys! I will try it and let you know if it did the trick!

0 Kudos
Message 4 of 10
(3,229 Views)

So i added the ZOrder method for the textboxes i create an select 'msoBringToFront' but still doesn't seem to make the missing text boxes visible. I tried playing around and moving the "visible" textboxes to the back and the method didnt affect those either. Any thoughts? Attached is the updated VI.

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

Try reading the shape visible property value just to make sure it is set to true. It is probably set to true as expected but it worth checking it.

 

Ben64

Message 6 of 10
(3,206 Views)

Ben64,

 

I apologize for my lack of response, was on vacation. As for your suggestion, i set the visble property to 'true' and again the same result.

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

Since you changed the OS it is probable that the parallel operations timing is different. The suggestion I would make is to avoid creating text boxes in parallel as in the attached picture. I would also recommend you explicitly close the references when no longer required (I partly did it in the picture).

 

ScreenShot001.png

 

Ben64

 

 

Message 8 of 10
(3,154 Views)

Ben64,

 

After the Thanksgiving break I gave your last suggestion a try. I changed the VI to create the text boxes sequential instead of in parallel as well as closing the references. Though my code looks much better and seems to be more efficient, the same issue with the text box display occurs. I just don't understand how it manages to add a handful of text boxes midway through and 'miss' the others. I appreciate your help greatly!

0 Kudos
Message 9 of 10
(3,131 Views)
Solution
Accepted by topic author SD_210435

I just wanted to follow up and say that IT never installed the service packs for Microsoft...issue is now resolved. Thank you all for your help!

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