10-30-2012 12:37 AM
I have an excel file which I read and write in my application.
When I run the application in development system, it works fine. However when I run the application as an exe and try to save the excel file, it says that 'The file already exists and Do you want to replace?'.
Why does this question asked for exe?
PFA my write excel VI
Thanks in advance.
11-07-2012 03:50 AM
The problem may be that when you build an exe, it adds another folder called 'builds' into the filepath.
A good way to fix this is to create a case structure, putting extra strip paths into your filepath if running an exe.
I have attached a screenshot of my code doing exactly this for you to look at. The code creates a 'base path' which is then used to reference all of my file paths in my code - and therefore, they will always have the right number of strip paths when it is run. (Note: in my code I have 2 extra strip paths, due to where I've placed the folder, but one should be sufficient.)
Also there is a 'Check if folder exists' VI which you can again link to a case structure, and change the filename if it already exists. Again, I have provided a screenshot of my code which does this.
Hope this helps,
Lou