06-26-2025 07:54 AM
Hello everyone,
I'm trying to implement a function where the user can delete a row of data from an Excel table. I made a very simplified example to show the problem I have. Here's the block diagram for it.
Screenshot 2025-06-26 142208.png
Screenshot 2025-06-26 142222.png
Say, for example, this is the data I have, and I want to get rid of the x.
hubi_24_0-1750941284540.png
Using RGT, I read the data from the table into an array.
Screenshot 2025-06-26 141731.png
Then I activate the row delete function, and it deletes the row from my array
Screenshot 2025-06-26 142137.png
The problem is, the "Append Table to Report.vi" only changes cells in the Excel file that are affected by the new table. Because the array has 1 row less now, the last row in the previous Excel file doesn't get changed or deleted, so the "g" in row 9 of the Excel file stays there.
hubi_24_1-1750941744294.png
And if I load the Excel table into the LabView array again, the "g" row gets doubled.
Furthermore, if I want to delete the last row on the table, It simply won't get deleted because the new array doesn't change that last row.
So is there a way around this? I'm very new to LabView, so there's probably many things I missed or don't quite understand yet.
Thanks in advance!
Solved! Go to Solution.
06-26-2025 08:19 AM
06-26-2025 09:52 AM
Expanding on what Gerd said, you can use Excel_Insert_Cells VI as a reference. It has everything you need. You'll just need to change the insert method to delete.
06-26-2025 09:57 AM
Alright, I just finished trying something out
I ended up creating this monstrosity, which somewhat works I guess.
hubi_24_0-1750949815391.png
Also thank you to aputman for the tip on using the Excel Insert Cells.vi as reference, which I wish I read before making this thing.
Cheers, Hubi
06-26-2025 10:04 AM
Make use of the Get_ActiveX_References. It simplifies a lot of the work.
aputman_0-1750950194563.png
06-26-2025 12:55 PM
As said, use Excel Get ActiveX reference to simplify the code. The way you implemented your code the last row of the table will always be deleted. You need to look at the content of each row to see if there is an "x". I attached an example of a possible way to do it. Note that I start with the last row of the table because if you start with the first and delete a row the index of the last row will change. I only use the content of the first column for the comparison, you can easily modify the code if you need to compare both columns.
delete line from table.png
Ben
06-27-2025 08:53 AM
ActiveX functions always yield such short VIs 🙂