LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

excel save

I have an application with a lot of excel functions going on using ActiveX. When I create a line to be added to the excel file it stays in memory but is not written immediately. When the LV app closes and uses close /save the file is written. I want to save each addition in the files in case the program crashes and does not exit gracefully. So that no data is lost.

Here is my function that adds each update to the excel file.

I thought the last activeX function would save the file each time I add something to the workbook.

It needs to update automatically without operator intervention.

Can someone tell me what I have wrong?

Thanks

Judd

Judd
0 Kudos
Message 1 of 8
(2,844 Views)

Have you looked at the Excel Specific functions in the Report Generation menu?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 8
(2,791 Views)

No

Because I am using specific reads and writes to specific cell locations and variable cell locations I did not use the report functions. It may be dofficult to rewrite the code to use. them. What I do not understand is why a save does not change the file on disk unless it only saves to the temporary file until close. I am using booth the activeX save (workbook) which has no other functions/options and the close with save function true. The close saves as I want. The save seems to do nothing. 

I don't want to close as there is the possibility someone else will try to read the file. When they dothey will open in edit mode which will force my program to re-open in read only mode which is not acceptable.

I will look at changing over to the report functions.

Thanks 

Judd

Judd
0 Kudos
Message 3 of 8
(2,773 Views)

Upload your VI in 2011 format.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 4 of 8
(2,764 Views)

Dear Judd,

 

You are using the correct function/method for save (Excel Workbook - Save).

Probably you check,

1. The sequence of the functions you are using

2. Error conditions,

3. Write Permission of the file

4. Write Protection/Properties of the Excel Cells

5. The Range you are using (Range of Cells)

 

Also I am suggesting to save the file before closing it (PFA).

 

Note that while debugging you can launch Excel Application with 'Visible' and put breakpoint before closing the excel file/or where you want.

So that you can cross-check that the write function is working properly.

 

Regards,
Yogesh Redemptor
0 Kudos
Message 5 of 8
(2,748 Views)

When you exit the application, do you use Save or Save As?  Could it be that, for your incremental saves, you haven't specified a directory to save in, but a directory is specified when you exit the application? 

 

When I suggested the Report Generation vi's, I wasn't necessarily saying you should switch over to them.  I guess you could if you want.  But you can also plop those VIs down and view the code to see the proper way of saving something.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 6 of 8
(2,736 Views)

excel.llb has excel string write.vi which I have modified mostly to accept a 1D or 2D array. It does not save until I call 

CloseWorkbook File.vi

 

Judd
Download All
0 Kudos
Message 7 of 8
(2,715 Views)

I am uploading one VI.Just take a look at it. Let me know this you are looking for?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 8 of 8
(2,702 Views)