07-21-2016 11:35 AM
Yes i can see the difference but how can i make an excel template that has first worksheet with heading and everything and the remaining work sheets has the table for test results. And one more thing test number are not constant in this case.
Also if i want this VI to work. Can you please guide me throgh...it would be very helpful..
07-21-2016 11:37 AM
Just open up Excel and create the worksheets like you explained. If you really need a variable number of worksheets, then you will have to create the sheets in LabVIEW. Just use the Add Worksheet VI followed by the Rename Worksheet VI.
07-21-2016 11:45 AM
Thats what i did. I create an empty excel file. Read it in my VI and write in first worksheet the heading and other things and then add worksheets for results but it returns an error.
If you can just shown me the way that every sheet is the same let say each sheet contain the heading thing and resulting table, i will be very thankful. Beacuse the program i attached is giving error.
07-21-2016 11:48 AM
No, you are calling "Add Worksheet" and then "Get Worksheet". You want to call "Rename Worksheet". You need to find out where in your program you are getting the error. Try probing the error wires to see where it occurs.
07-21-2016 11:58 AM
i tried this approch using the following links:
https://decibel.ni.com/content/docs/DOC-20014
https://decibel.ni.com/content/docs/DOC-4262
What i am doing here is loading my file then entering the title etc, then getting its properties,then adding worksheet and then loading that worksheet for entering data into it.
07-21-2016 12:02 PM
Ok, well I notice right off the bat you added 1 to the index number in the example you provided. Please try to find where your error is occurring.
07-21-2016 12:05 PM
I am trying. But if you know it please point it out that is why i posted the question here. I will try to make it correct if i can
07-21-2016 12:07 PM
I am trying. But if you know where it is please point it out thats why i posted so some one can help. Then i will try to resolve it if i can.
Regards
Omer
07-21-2016 12:16 PM
No, I don't know where the error is occurring. Here is an example
07-22-2016 12:44 AM
Omershah,
You describe making a multi-sheet Excel Workbook. Here's a question for you -- is there a "standard form" for the WorkBook, i.e. it always has a WorkSheet called "Header", "Test 1", "Test 2", and "Test 3"? Or does it have a more "flexible" design, say a Header Worksheet and then N "Test" Worksheets (called "Test 1", "Test 2", etc.)?
In the first case where the format is fixed, you can create a "dummy" (or "Template") Workbook (call it "Dummy.xlsx") with Header, Test 1, etc. WorkSheets. You open Excel specifying Dummy.xlsx as the Template. You use the Excel Get Worksheet function, specifying the name of the Worksheet you want (e.g. "Header"), write data to it, then get Test 1, write more data, etc. When you are done, you save the Worksheet using a different name (so you can reuse the Template).
In the second case, you pretty much need to create each Worksheet "from scratch". Excel, by default, gives you three when you open it, called Sheet 1, Sheet 2, and Sheet 3. Select a Sheet, put whatever data you want on it, select another sheet, put more data, and if you run out of Sheets, use the Excel Add Worksheet to create more of them. When you are done, name and save the Workbook.
All of this assumes you have access to the Report Generation Toolkit, which has all those nice functions that Gregory showed you and that I described here.
Bob Schor