12-07-2016 08:25 AM - last edited on 12-07-2016 11:48 AM by Kristi_Martinez
Hi RobertoBozzolo,
I saw you gave a lot solutions of the CVI in the forum. i met a question of using the CVI. Can you give me some advises?
i use the cvi to send a string to the Excel for calcul the value. For example, i use this :
ExcelRpt_SetCellValue (ExcelWorkSheetHandle, "B3", ExRConst_dataString,"=5*3+SIN(30)");
And then i got a resualt of the calcul valres = 14.01 with the after code:
ExcelRpt_GetCellValue (ExcelWorkSheetHandle, "B3", ExRConst_dataFloat, &valres);
But the condition is i have to install the Microsotf Excel in the windows first. And then i can use the CVI COM to call the Excel to deal with my formula (Microsoft Excel 9.0 Object lib AND Excel Report).
So, for the PC which didn't install the Excel, what can i do for my calcul string like "=5*3+SIN(30)" ??? Can someother lib replace the Microsoft Excel 9.0 Object lib?
Thank you so much!
12-08-2016 11:04 PM
If the formulas are similarly simple, as the one given in your post, then you can parse them in your code and calculate the result without any other external program.
12-09-2016 07:07 PM
I second ebalci in his response: with functions included in both standard C and CVI libraries you have a powerful set of instruments to perform mathematics on your data. Unless you wnat to access some very specific Excel function there is no need to use that instruments to perform calculations, and even more since, as you already observed, you need Excel to be installed on the machine to access it.