Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i open xls file from script

Status
Not open for further replies.

powerbuilde

Programmer
Oct 2, 2010
29
0
0
EG
I have xls file
I want to open it using MsExcel
when I write
run("excel.exe "+ ls_path)
where ls_path is the path of the file
it does not work
I must write
run("D:\Program Files\Microsoft Office\OFFICE11\excel.exe "+ ls_path)

where D:\Program Files\Microsoft Office\OFFICE11\excel.exe
is the exact path(directory) of excel

my program may run on a computer that the excel is at another path

how can i run excel to open my file
thanks
 
'Normally' .XLS or .CSV files will launch within Excel (this assumes a normal file association between them and Excel). With this in mind you can just 'run' the file and windows will handle launching Excel.

Matt

"Nature forges everything on the anvil of time"
 
it did not work -no respond at all- the xls is already assciation with excel - In Windows when i click on start button -choose run -write only the name of my xls file it runs but in PB script i must write the program run the file first then write the name of the file- the problem is that the path of excel program may be at different path? thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top