Posted on 2006-06-27
I have an app that creates an excel file and then opens that excel file when it is finished. This works fine except when there are spaces in the file name. For example if I have a file called:
my excel file.xls
I will get 3 error messages from excel when it tries to open the program. It see's each word (my, excel, file) as a separate file and of course can't find them. Here is my code:
load.exec("C:\\Program Files\\Microsoft Office\\OFFICE11\\EXCEL.EXE "+sFileName);
I have also tried:
load.exec("'C:\\Program Files\\Microsoft Office\\OFFICE11\\EXCEL.EXE "+sFileName+"'");
but this throws an exception.
The obvious answer to this is to not put any spaces in the file name but that will not work for my requirements.