hello
i´m trying to open an .xls file from my program with
system("C:\\PROGRAM\\Microsoft Office\\Office\\excel.exe myfile.xls")
Problem is, it doesn´t like the space between Microsoft and Office
any suggestions??
Help plz!!
hello
i´m trying to open an .xls file from my program with
system("C:\\PROGRAM\\Microsoft Office\\Office\\excel.exe myfile.xls")
Problem is, it doesn´t like the space between Microsoft and Office
any suggestions??
Help plz!!
Code:system("\"C:\\PROGRAM\\Microsoft Office\\Office\\excel.exe myfile.xls\"") ;
I tried system("\"C:\\PROGRAM\\Microsoft Office\\Office\\excel.exe myfile.xls\"");
but it still won´t work..
Are you sure it's the right path, and that you've included stdlib?
-Govtcheez
[email protected]
yup, i´ve include stdlib.h and I´m sure it´s the right path (dubbelchecked)
You shouldnt have to specify the full path, not even mention "excel.exe" *.xls is associated with it and simply:
should do it!Code:system("myfile.xls");
I just tryed it and it works!
system("myfile.xls");
maybe it´s my computor, cuz it still won´t work
I´ve also tried system("C:\\WINDOWS\\notepad.exe myfile.txt");
and this work, but not system("myfile.txt");
any ideas??
Are you using some pre-DOS brain-damaged compiler which knows nothing of long filenames, spaces in filenames or how associations work?
nope, i´m using VC++ on Win 98
Interesting. I would have thought PROGRAM would be PROGRAM FILES.Originally posted by Unregistered
Code:system("\"C:\\PROGRAM\\Microsoft Office\\Office\\excel.exe myfile.xls\"") ;
If you have a windows compiler (Borland Builder, MSVC++, Bloodshed.....) dump system and use ShellExecute()
Its more efficient. If you dont run it from the same directory, substitute "Myfile.xls" for "C:\\mydir\\Myfile.xls" or whateverCode:#include <windows.h> int main(void){ ShellExecute(0,"open","Myfile.xls",NULL,NULL,SW_SHOWNORMAL); return 0; }
thanx!
now it´s working!