LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Open excel file from program directory?

Hello,

I use this command to open excel file:

 Excel_Rpt_WorkbookOpen (appHandle, "C:\\Users\\SSUControl\\SSU.xls", &workbookHandle) ;

Problem is that when i copy program somewhere else, it doesn't find that file.. Is there any way to make that code so that it would always open that file from same directory than program?
0 Kudos
Message 1 of 2
(3,158 Views)

Have you tried to pass to the function the filename only? It could open it assuming it is in the program directory.

Otherwise you can use GetProjectDir to obtain your executable pathname, then pass it to MakePathName together with your filename to build the pathname of your excel file.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,153 Views)