Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to programmatically save recipes to an excel file without overwriting the previous entry?

Solved!
Go to solution

I'd like to be able to save recipes every four hours to an excel file without overwriting the previous entry.  It would function as a "save as" button, but instead of inputting a new name, the recipe name along with the date and time is what the file would be saved as.  Any thoughts on if this is possible or how it can be accomplished would be great.

0 Kudos
Message 1 of 5
(7,892 Views)

Try the datatable.

 

I connect the recipe datamember to the datatable datamember. Create a counter to count a pulse signal(Timer1). The database filename = "d:\data"&Counter1&".xls". Its export = Timer1. Then, it will periodically export the data into the xls file. The data file name will change with the counter, such as data1.xls, data2.xls, etc.

 

You can use expression to get the date or time value, and add them in the file name. Or you can write the time value to the xls file.

Ryan Shi
National Instruments
0 Kudos
Message 2 of 5
(7,881 Views)
Solution
Accepted by topic author DST1
Everything looks good except for one minor detail that maybe you could help me with.  Instead of naming the file "data", I want to use the contents of datatable cell C1 as the name.  Could I do this in Filename= or should I use an expression.
0 Kudos
Message 3 of 5
(7,865 Views)

For example, the file name is in C1.txt, just set Filename = "d:\"&Table1.C1.txt.

 

 

Ryan Shi
National Instruments
0 Kudos
Message 4 of 5
(7,853 Views)

just put another row in the excel file, do not forget that the option that connects excel with NI application must be enabled.

 

0 Kudos
Message 5 of 5
(3,648 Views)