LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems in compilation

Part of the programme that i've written is to generate an excel report and save it as an excel file, the name of which is specified by the user. It works fine when it is not compiled. However, after compiling into an executable file, it refused to work. After the user has specified the file name, nothing was saved. Could anybody tell me the possible reasons for that?
0 Kudos
Message 1 of 3
(3,031 Views)
A look at the code would certainly help in this case, but a cursory guess would be that if you are using the 'Current VI's Path' primitive to derive the directory path for your file that you need to strip the path again for exe's only. The path for abc.vi in the development system is 'pathname'\abc.vi in the runtime system it is 'pathname'\abc.exe\abc.vi.

You can use the app.kind property to determine whether another pstrip of the path is necessary. See attached.

If this is not helpful please post your code.
Message 2 of 3
(3,031 Views)
This would be my guess too. I've built very similar applications before and had the same problem you are. It took me days to track down the problem to this, and it was exactly what Spaz suggested. You have to strip the path twice when you're using this as an executable.
J.R. Allen
0 Kudos
Message 3 of 3
(3,031 Views)