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.
Why do you use the word "Excel"? The term "Excel Files" should be reserved for files with the extension .xls and .xlsx that use the (proprietary) Microsoft Office Excel format.
When LabVIEW opens a file for writing, it generates a reference number that it uses internally to identify the file it has opened. That number is being circulated around the shift registers in your while loop. After your VI starts, there is no way to change the reference number for the file you want to write. LabVIEW will continue to write values to the file selected when the VI is run while the Boolean is true and will not write values while the boolean is false. In this sense, you can think of it as a 'pause logging' button.
I would be tempted to create an Event Structure, and add a new button to create a new file. This event would close the old file, and then prompt the user for a new file. You could use the existing code to handle the stop case, or move closing the file open when the stop button is pressed to another Event Structure case for the stop button value change.