LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

take an existing spreadsheet (with macros), and make a new copy of it with another name, then add data later

Hi,
I am using a cRIO with LV7 (will be upgrading to 8 at another time).
 
Currently I have a cRIO program that performs some operations and writes data to an xls spreadsheet (program written by someone else) I think it's just writing to a text file with a *.xls extension because I'm able to open this file with notepad and I see comma delimitted data. The file is created at the beginning of the program, and data is appended to it as the program runs. Everything works fine there..
 
Now here's where I need to get to:
 

I have this excel workbook (whatever excel calls their files these days) that contains some macros. It has two worksheets. The first page will be blank and will have data added to it. The second worksheet has a macro to draw a chart. This excel workbook will be my "template" and will reside on the cRIO.
 
I need to do the following to replace the file save operation given above. (rather than opening an appending to a text file with an xls extension)
 
1) Create a duplicate copy of the excel workbook with a user defined filename. (essentially creating a new excel workbook to put data into but it will also contain the macro)
2) Write data to this spreadsheet, but only on the first worksheet. (the blank worksheet).
 
When I open the file in Windows I get the "Macro warning blah blah" message. I'm concerned that this will pop up in Labview. If so, how does Labview handle this?
 
How do I ensure that I only write to the first worksheet of the workbook?

Any advice is greatly appreciated!

Regards,
 
Jeff
 
 
0 Kudos
Message 1 of 3
(2,607 Views)

A good place to start are with these example VIs.

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DD9C56A4E034080020E74861&p_...

I just tried it with an Excel workbook that has a macro and no pop-up occurred.

0 Kudos
Message 2 of 3
(2,596 Views)
Thanks for the reply. Although that looks a little more complicated than I would prefer, I will give that a try!

Jeff
0 Kudos
Message 3 of 3
(2,578 Views)