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
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"
?
start "C:\Program Files\Microsoft Office\OFFICE11\excel.exe"
?
ASKER
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.
ASKER
2003 points to:
C:\Program Files\Microsoft Office\OFFICE11
2007 points to:
C:\Program Files\Microsoft Office\Office12
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?
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\(ExcelFilena me)"
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
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"
"c:\directory\(ExcelFilena
ftype Excel.Chart="C:\Program Files\Microsoft Office\OFFICE12\EXCEL.EXE"
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
start "C:\Program Files\Microsoft Office\OFFICE11\excel.exe"
(rename the path and filename as appropriate.)
Hope this helps!
:o)
Bartender_1