LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel not calulating formula, so when I go to read the cell with the formula in it I get an error

Hi,
 
ActiveX properties and methods are very specific to the application (Excel in this case) and tehy may or may not expose all the features of the application. I tried looking into ActiveX properties and methods for Excel and I could not find one that would let me activate/enable the ATP (analysis toolpak) addin. However, I found that if you open Excel, activate the addins, save the Excel sheet and now use LV to communicate with Excel, it works fine (even if the Excel sheet is closed). 
 
Ankita
 
0 Kudos
Message 11 of 25
(1,682 Views)
You said you got it to work when the worksheet is closed. But does it work for you when excel is closed. What I mean is do not have any excel applications open when you press the play button on my main vi. Let my program open and close excel by it self. If it works for you that way there is something different with my excel 2000 and yours. I tried your idea to manually enable toolpaks and then save file and it still doesn't work when I have all excel applications closed at start of test. :(
0 Kudos
Message 12 of 25
(1,680 Views)
Hi,
 
It does work for me when the Excel sheet is closed. However before closing the sheet and excel , I make sure that the Tools>> Add-Ins>> Analysis ToolPak is checked and that the cell i11 is showing the correct value. I then save the worksheet and close it. I am using Excel 2003 and Win XP Pro.
 
Ankita
0 Kudos
Message 13 of 25
(1,663 Views)
??? It doesn't work on this end using Excel 2003 Win XP Pro. I open the file remove addins then check addin's ( i11 ) looks good then I save. Can you get it to work multiple times. It has work for me sometime the first try and if I try again it errors out. Also can you post
your excel sheet maybe some is getting set on your sheet that isn't working on my version of excel.
 
If that doesn't work. I'm ready to give up for another week or two
 
Thank you for all your help
0 Kudos
Message 14 of 25
(1,659 Views)
On second though can you zip up LLB and excel file. Who knows what I'ver changed since I sent you the file.
 
THanks
0 Kudos
Message 15 of 25
(1,656 Views)

I'm having the same error, and by all indications the analysis toolpak add-in is always installed and enabled.

 

It seems curious, though, that there are other instances of the DEC2HEX function being employed in the spreadsheet at i23 and i25, but they never result in a #NAME error. It only happens when LabVIEW accesses one of the cells indirectly involved in the calculation.

Jarrod S.
National Instruments
0 Kudos
Message 16 of 25
(1,644 Views)

I think what is happening is the other two dec2hex conversions are not being recalculated. Excel is just showing the last saved value. If when you get the error go to the input cell that will change the other dec2hex conversion cell B20 and change the value slightly. That way excel will have to recalculate the dec2hex conversion. What you will see is that it will show the same error (#Name). It like the active X calls forgot one function, that is to recalculate using the addins.

Sorry it didn't work for you either. If you have any luck let me know. I will also keep looking.

0 Kudos
Message 17 of 25
(1,648 Views)
Hi,
 
I have found a workaround...(I hope). Visit this link and look for the response by Stephen Bullen. Please let me know if it was helpful to you. As for the ActiveX property called "Addins", I would suggest contacting technical support at Microsoft(searching on Google did not help).
 
Ankita
0 Kudos
Message 18 of 25
(1,628 Views)
I had the same issue with ActiveX. What I did to fix it was place code snippets of the functions I wanted in the spreadsheet's VBA project file. I found some conversion code snippets, copied and pasted them into modules, changed my formulas to use the functions in the modules and that took care of it.
 
It certainly appears as though ActiveX doesn't expose built in functions of addins such as the VBA analysis toolpack, etc...
 
If you want further explanaiton, just reply...
 
Jason
0 Kudos
Message 19 of 25
(1,551 Views)
By the way acalmeyn, you might want to try the ConvertHexadecimalToDecimal function that I used (click the link). I can instruct you how to add it to your project if you need me to.
 
Good luck!
 
Jason
0 Kudos
Message 20 of 25
(1,549 Views)