LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel Readpage Save as another file problem

Hi,
 
 
I have attached the VI needed If you have any problems please let me know. This VI reads a excel page the user points to and displays the results. I have added a single cell where you can change the position of a single cell coordinates so that you can point to a single cell of your choice and retrieve that data. So my problem is now I want to save that data from that single cell to ANOTHER excel file. However, this is not working correctly for some reason I do not know why I believe I have done everything correctly hopfully it is just my inexperiance. I will continue to work on this and update it as I get more time but at the current moment I have hit a brick wall. I have visited the EXCEL BOARD and the vi is from there but I had to add somethings to it in order for it to work correctly as before it wouldn't even run because it was missing some connections and nodes.
0 Kudos
Message 1 of 11
(3,288 Views)

*updated*

 

Found problem with row and col roles were reversed. see attached for new file.

0 Kudos
Message 2 of 11
(3,282 Views)
Your code doesn't make much sense. You're reading the contents of a spreadsheet, and then quitting Excel. You then try to save the workbook to a different name (after you've already quit Excel), and completely separate from that you're indexing out an element from the 2D array of variants. ???
0 Kudos
Message 3 of 11
(3,278 Views)
Well Everything works EXCEPT the saving portion. If you make an excel file right now and put random numbers/ letters in cell lets say A1 in the row and colum section you would put 0,0 and it will return the value in the cell A1. If you put 0,1 it will return the values from A2 I use the 0,0 method because it is simple to use and locate the information from a single cell. I don't know of any other method to do this. My problem is the information I extract from the cell I want in the spreadsheet won't save in a new excel file. I am very confused on how this works I got this file from the EXCEL BOARD but it was buthered and I had to do some repairs to it from the little experiance I have to get it to work the way I want unfournatly I can't get the dam thing to save in a new file. I hope I haven't lost you ahaha.
0 Kudos
Message 4 of 11
(3,275 Views)
hmmm...it seems the excel baord is a thread? But most of the examples don't show how to save the files.
0 Kudos
Message 5 of 11
(3,254 Views)
Hi MrSafe,
the attached vi (LV71) shows how you can save a workbook.
Mike
0 Kudos
Message 6 of 11
(3,251 Views)
I will give it a try and hopfully it will help me mvoe along thank you I will post again If i have issues

0 Kudos
Message 7 of 11
(3,247 Views)

@MrSafe wrote:
hmmm...it seems the excel baord is a thread? But most of the examples don't show how to save the files.


Yes, it's a thread, because NI never created an official board. Did you take a look at the 2 toolkits that are there? One is in an attachment in reply #2, and another is in a link to sourceforge, in reply #18.
0 Kudos
Message 8 of 11
(3,239 Views)
Yes  I did. I have both toolkits but they are incomplete some of the files are missing and I can't load files like saving to excel and so forth. I have searched heaven and earth for templates. My biggest problem is that I take data from excel which I then need to write into another excel file which I then need to save. I can do the first part which is take data but saving that data into a new excel file is a whole new beast to take on which has been handing my behind quite throughly last few weeks.

My hope is that by looking at how people are saving/writing into excel cells I can create my own vi to suit my needs.
0 Kudos
Message 9 of 11
(3,235 Views)
I took a look at the toolkits. The VIs are there, the problem is that the linkages are a bit screwed up so the top-level VIs think the subVIs are in different places. Also, the toolkits were written using an older version of Excel, in which the "Range" object had the property of "Value". Excel 2003 uses "Value2". So, if you have Excel 2003 even after you load up the VI the "Value" property nodes need to be changed to "Value2". This is not a fault of the toolkits - this is due to Microsoft changing the ActiveX interface.

As to your issue: Your basic steps are to:
  1. Create a new workbook
  2. Write values to cells
  3. Save workbook
The "Write Table to XL" that ships with LabVIEW does that. Launch the Example Finder (Help -> Find Examples) and search for "excel". Then, open the "Write Table to XL". The "Table" control is the data that you want to write. It can be a single cell or multiple cells. If you have a single value, just make a 2D array out of it. As it's written it will prompt you if you want to save the file. This is from the "Close" method. You can wire a True constant to the "SaveChanges" parameter and a path to the "Filename" parameter.

0 Kudos
Message 10 of 11
(3,224 Views)