From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI to update excel report every time is ran

Solved!
Go to solution

HI all,

Im new to the LV world and i was wondering if someone here can help me with my current issue.

Im trying to create a Vi that every time its ran it records the selected values into a spreadsheet(template) and saves it. 

so far i have i working as mention before, the issue is i dont want to create a new report every time the Vi is run  but to update the same report by moving one row down in the spreadsheet.

 

So lets say I run the VI to check a voltage and current, it records the values (which i get it do so ) in row A1 and A2.

Next day I run it again and it should record the values in the same spreadsheet but B1 and B2 and so on and on.

I do get it to work if i use the write to delimited spreedsheet VI but that is only for .CSV and i needed to be on a excel file because the template is a report  that has its own format and conditions  

 

 

below is a screenshot of the Vi ,any ideas on how to get the Microsoft parameter cluster to increase  by 1 every time the VI is ran.

Thank you

Shawn19_0-1598932784729.png

 

0 Kudos
Message 1 of 8
(1,326 Views)

Hi Shawn,

 

you could read in the spreadsheet first to determine the first free cell to place the new values!

(In ExcelVBA you would do it similar by searching for the end of the current data…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(1,299 Views)
Solution
Accepted by topic author Shawn19

Hi Shawn19,

 

I had a look at your problem and was able to get your concept to work. I did however use the Create Report.vi. I used it because I couldn't see any other way to do it, and as long as you are replacing the file in the Save File stage with replace dialogue false you simply get the same file in the same place at the end of run. I don't know exactly but this creation and disposal could have an impact on computer memory but if you're only doing this once a day with one file it should be not too bad. Anyway, I have attached the vi and a screenshot of the output in excel. Note that there are only two Test One's because I ran it twice thinking it hadn't worked the first time 🙂

Hope this helps, I took what GerdW had said on board and found the vi they were talking about.

 

Regards

Izzy

Download All
0 Kudos
Message 3 of 8
(1,279 Views)

Hi Izzy,

Thank you for your input and fast reply but i cant open the VI since im using LB 18 could you save it as a previous version and posted again? or maybe  a screenshot of the block diagram.

Also the VI is actually being used and works great, its used every 5 days as a sanity check to make sure all components haven't drifts outside tolerances but i want to record the values so I can see how much (or if ) its drifts out of tolerance, no memory issue so far.

 

again Thank you

 

0 Kudos
Message 4 of 8
(1,246 Views)

Hi Shawn,

Yeah that's no problem! I'm not sure how to save it as a previous version unfortunately but here is a screenshot of the VI. The one vi you're missing is the Excel Get Last Row vi, with that added in to your program you should be fine.

Thanks

Izzy

0 Kudos
Message 5 of 8
(1,217 Views)

Hi Shawn,

Just to help convert the VI given by IzzyPrice to version 18.

Hope it ease your troubleshooting process


0 Kudos
Message 6 of 8
(1,208 Views)

Thank you!

0 Kudos
Message 7 of 8
(1,174 Views)

Thank you very much! this work perfect! i really appreciate the help!

0 Kudos
Message 8 of 8
(1,172 Views)