LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

copying from one spreadsheet to another

I am trying to automate a process which in the past consisted of opening several spreadsheets of raw data and copying each one with paste-special-values into a template. I have no active x experience and am using the goop excel library. Since the pages consist of both string and numeric I used read string and write string. Two problems occur. First is that when I copy the two pages that were excel calculations from another page they come out in scientific notation with 14 decimal places. Very messy. I tried reformatting to floating point but it would not take. It seems as if excel is getting confused as to whether it is a string or a number. If I hit f2 and go into edit mode then exit the cell then it reformats to floating
point. But I can't go editing every cell one by one. I might have to break the sheets down to text areas and numeric areas when I read them but that is still a lot of work. I want to just read the whole page at once. The goop library has a copy worksheet but it is only to the same workbook, not to a second workbook. The second problem I see may be the same cause. Another of the sheets is a graph and the x values are coming out all wrong. Instead of using the values in the column specified, the points come out numbered 1, 2, etc. Kind of like if I hadn't specified the indepenent axis at all. I'm thinking that again excel may be seeing numbers as text and not know how to graph it.
0 Kudos
Message 1 of 4
(2,753 Views)
I've found that if I need to write numbers to Excel that I'm going to use in any sort of calculations or graphs that you need to write them as numbers, not strings. You will probably have to do two seperate read/write operations, one for your numbers and the other for text cells. I don't think there is really too much of a way around it. Unless you were able to format the cells to numbers after they were written programmatically, but I've never done this and don't know if its possible.

Good luck,
Brian
0 Kudos
Message 2 of 4
(2,753 Views)
Brian Vibert wrote in message
<506500000005000000EE720000-1019262487000@exchange.ni.com>...
>I've found that if I need to write numbers to Excel that I'm going to
>use in any sort of calculations or graphs that you need to write them
>as numbers, not strings. You will probably have to do two seperate
>read/write operations, one for your numbers and the other for text
>cells. I don't think there is really too much of a way around it.
>Unless you were able to format the cells to numbers after they were
>written programmatically, but I've never done this and don't know if
>its possible.
>
>Good luck,
>Brian

Excel will convert ascii to numbers, one to each cell, when they are
seperated by tabs. I don't remember the exact format string, but we have a
VI at
work that converts numbers to ascii before they are sent to file.
There is also a date and a time, and each gets its own cell. We copy and
paste from the output file to an Excel worksheet where we perform
calculations.

In another application I had a 2D array of text (experiment information with
column headers) and a 2D array of numerical test results that were sent to
file. I, like you mentioned, used 2 writes to get them to the same file

Steve O.





-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
0 Kudos
Message 3 of 4
(2,753 Views)
Yes at present we also are copying and pasting from one spreadsheet to another. The problem is that there are 10 pages to copy and that takes time by hand. I was hoping to automate the copying using labview, but have problems of labview spreadsheet vi's will only write to one page and labview excel toolkit will write ascii to several pages but excel will not interpret it as numeric.
0 Kudos
Message 4 of 4
(2,753 Views)