10-03-2013 12:12 AM
Hi,
I have a created a single sheet excel template. When my LabVIEW program runs, I want to insert a data table in the excel report for each time the loop runs. Each time I add a new sheet in the report and add the data table. I want to get the same template in each new sheet. Please let me know how to insert the same template in each new sheet in the same file. Right now I need to create template file with 5-6 worksheets each with the same format.
Rashmi
10-03-2013 09:09 AM
You need to use the ActiveX "copy" command on the Sheets object. The image below is from the Report Generation toolkit for adding a new sheet to a workbook. This needs to be modified to change the 'Add' method to 'Copy'. You will then need to select the sheet index that you want to copy and tell the Copy method where to place the new sheet (Before or After).
10-04-2013 02:14 AM
Thanks for your reply.
I tried to do the same you have suggested. As the "Save As" option does not work, I tried to copy the block diagram into a new vi but it gives the error. I am attaching here the screen shot of the same.
10-04-2013 10:09 AM
I am not sure how you extend the functionality of the Report toolkit. I was suggesting that you use this code as a starting point for your own VI. You will have to create the Excel references, open your workbook, copy the worksheet, etc.
10-04-2013 10:55 AM
I tried to copy the block diagram into a new vi but it gives the error
I'm no expert in OOPs but as little as i know you can't use any class on the block diagram of any VI.
A class is specific to a LabVIEW project or a templete
10-10-2013 06:08 AM
I could not find any solution so I created the template programatically and used it as many times I want in the program. Its bit tedious but worked well.
Actually it would have been easy to create the template in excel and use it rather than creating programatically.