LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MS Office (Excel) Toolkit - trouble formatting cells

I have the MS Office toolkit 1.1 and LabVIEW 7.0. I am using 'Excel easy table' to write arrays of strings (number strings and titles, etc.) to a spreadsheet but I also want to control the number of decimal places and the number format.
I want to use 'Custom ##0.0E+0' number format (engineering notation) and I want to have 3 or 4 decimal places. Currently, the format of the number written into Excel changes based on whether I converted from a number to an engineering string (engineering notation is not preserved in Excel) or if the string in the array is read straight from my GPIB query. I want to be able to control these things within LabVIEW. Any suggestions are appreciated.

Sara
0 Kudos
Message 1 of 4
(3,135 Views)
Hi Sara,

Is there any way you could send me a VI that illustrates the problem you are having? I was under the impression that if you pre-configured the format of the cells in Excel, then whatever you wrote to them would conform to that format...however, I haven't dealt with this issue in a while, so memory may be serving me incorrectly.

I'd be happy to help if you could send me a VI that helped me more fully understand the problem.

-D
0 Kudos
Message 2 of 4
(3,135 Views)
Do you mean pre-configure as an Excel default (for all new files) or within the particular file you are writing to?

My VI creates a new file so there is no file to configure before the data is written.

I will attach the VIs in question. 'Dynamic call with report writing.vi' is the main VI.

I will look into setting defaults within Excel. If this is possible, it will solve my problem for now.

Thank you,

Sara
0 Kudos
Message 3 of 4
(3,135 Views)
Hi Sara,

The easiest thing to do would be for you to create your new report based off a template Excel file. I have attached a sample VI and a sample Excel template that show how to do this. If you know which way you want individual columns to be formatted, this is the easiest solution. If, however, you might have different formatting that needs to be assigned dynamically, you will have to use the more advanced Excel VIs, like the "Excel Set Cell Format.vi", located in the Excel Format subpalette. There is an example that ships with the Report Generation Toolkit that uses this VI to set the colors of certain cells in the spreadsheet...the example is located at examples\office\Excel Examples.llb\Conditionally Formatted Spreadshee
t.vi.

I hope these suggestions help. Good luck,
-D
Download All
0 Kudos
Message 4 of 4
(3,135 Views)