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: 

Adding Category Axis Label using ActiveX

I have used this code for past versions of Excel but since my upgrade to Excel 2016 I get an error when I try to apply labels to the category axis. I searched and could not find if the property node has changed. I'm using "CategoryNames". Any help would be appreciated.

0 Kudos
Message 1 of 12
(3,218 Views)

I don't have Excel 2016 on this PC but I've seen funny things happen depending on the state of the Excel window. As a quick check you could try running the code with the Excel window minimized.

 

Ben64

0 Kudos
Message 2 of 12
(3,202 Views)

Thanks, but that didn't work. I tried minimized, maximized & normal.

0 Kudos
Message 3 of 12
(3,177 Views)

Hi bfeddeck, 

What is the error message you are seeing? 

 

Angela Li

Applications Engineer

0 Kudos
Message 4 of 12
(3,140 Views)

Error -2147417851 which is undefined.

0 Kudos
Message 5 of 12
(3,133 Views)

Have you looked at these two discussion forum posts yet? The users seem to be experiencing a very similar problem

 

http://forums.ni.com/t5/forums/v3_1/forumtopicpage/board-id/170/thread-id/327397/page/1

http://forums.ni.com/t5/LabVIEW/Excel-Unknown-Error-2147417851-when-using-any-Excel-ActiveX/m-p/6560...

 

Angela Li 

Applications Engineering

0 Kudos
Message 6 of 12
(3,125 Views)

You could try using plain text label, something like (label1,label2,...). If you don't get the error then it is probably caused by the syntax. Maybe Excel 2016 doesn't accept =('..', or require a double quote. Worth trying. You can also reselect the CategoryNames property by clicking on it and reselecting it.

 

It tried this part of the code with Excel 2010 and it worked fine.

 

Ben64

0 Kudos
Message 7 of 12
(3,120 Views)

I tried the plain text, same error. I tried reselecting the property, same error. I tried deleting and adding back in the property, same error. I had Excel 2010 and it worked for me too. This started when I upgraded to 2016. The Excel property I'm trying to write to is called "Category Labels" but I can't find that specific property in LabVIEW. CategoryNames is what I have been using.

0 Kudos
Message 8 of 12
(3,113 Views)

Hi bfeddeck, 

I linked a couple of forum posts further up the thread, were they helpful at all? 

 

Angela Li 

Applications Engineer

0 Kudos
Message 9 of 12
(3,085 Views)

I tried all of the suggestions in the links but the error is still there.

0 Kudos
Message 10 of 12
(3,071 Views)