Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Opening Excel File with Space in Filename Using Lookout Run Object

Primary Software: Lookout
Primary Software Version: 5.1
Primary Software Fixed Version: N/A
Secondary Software:

Problem: I have an Excel file named Analog Values.xls that I want to open in Excel using the Run object in Lookout. So I set the parameter in the object's property dialog box as follows:

Command line = "C:\Program Files\Microsoft Office\Office10\excel.exe c:\data\Analog Values.xls".

When I run my process, Excel loads properly. But it gives me two errors saying that

c:\data\Analog.xls not found

and also that,

Values.xls not found.

I do no see this problem if I try to open a file without any spaces in the filename. Why does this happen and how can I fix it?

Solution: This is an expected behavior since the Command line parameter of the Run object expects DOS formatted commands, spaces are not allowed in this format. You will see similar behavior if the Excel file is saved in a directory that had spaces in its directory name.
To avoid this issue, you may only specify files as command line parameters that have no spaces in their path when using the Run object. However, it is okay to have spaces is the path of the actual executable. For instance,

Command line = "C:\Program Files\Microsoft Office\Office10\excel.exe c:\data\AnalogValues.xls"

will work fine even though there are spaces in the path of the Excel executable. But the path for the parameter to this executable, which in this case is the Excel file, cannot have any spaces.

Related Links:

Attachments:





Report Date: 10/07/2003
Last Updated: 10/22/2003
Document ID: 326AK9DS

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit