Link to home
Start Free TrialLog in
Avatar of garbertravel
garbertravel

asked on

batch command open excel 2003 and not 2007

I am trying to create a batch file that will launch a file in excel 2003 on machine that is running both excel 2003 and 2007
Avatar of Bartender_1
Bartender_1
Flag of Canada image

Have you tried using the entire path to specify the executable?

start "C:\Program Files\Microsoft Office\OFFICE11\excel.exe" "c:\<path>\<filename>.xls"

(rename the path and filename as appropriate.)

Hope this helps!

:o)

Bartender_1
Avatar of garbertravel
garbertravel

ASKER

I tried that and it still launches Excel launched Excel 2007.
Does it open Excel 2007 if you just use

start "C:\Program Files\Microsoft Office\OFFICE11\excel.exe"
?

It does. but if I click on that file it runs on 2003. I don't because I just did a test with word and it launched 2003 fine.
Can you double check where the executable for Excel 2003 is? It sounds as if the path is pointing to Excel 2007.
2003 points to:
C:\Program Files\Microsoft Office\OFFICE11

2007 points to:
C:\Program Files\Microsoft Office\Office12
Is Excel set to be the default spreadsheet software?

If you click start, then run, and just type "excel" and click ok, which program opens?
I assume you are doing this on a local machine (not remote)...

If you are doing this on a local machine, you will want to temporarily associate the filetype with a certain program (Office2003) to open the file, then re-associate the filetype back to the original program (Office2007).

To do this, you would use "FTYPE"
From a CMD prompt, type FTYPE to display all current associations. (Be quick with the pause button or you will miss the beginning of the list)
If you use something like this in your .BAT file it should work.

Just open notepad, put the following in, then SAVE AS a .bat file.

:top
c:
cd\
ftype Excel.Chart="C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" /e
"c:\directory\(ExcelFilename)"
ftype Excel.Chart="C:\Program Files\Microsoft Office\OFFICE12\EXCEL.EXE" /e



Hope that at least gets you in the right direction. You may need to associate a different file then in my example, but you should be able to see what it is called when you look at FTYPE in the cmd window.

-Chris

ASKER CERTIFIED SOLUTION
Avatar of Klitos
Klitos
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial