Open multiple Excel files in separate instances with batch file
I am running multiple instances / files of Excel that require a manual restart of the PC daily. Currently I save all my Excels, restart my computer, and then have to open each file separately, which is pretty handy. Does anyone know of a program that I can run that will open the same Excel files in separate instances of Excel upon restart?
Decision:
@echo off
setlocal EnableDelayedExpansion
set "excel=C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe"
for %%a in (
"R:\Other Stuff\Name\text_excel_1.xlsx"
"R:\Other Stuff\Name\text_excel_2.xlsx"
) do start "" "%excel%" "%%~a"
Previous changes:
I got this far with the package, but the second instance of Excel won't open unless I close the first one.
"C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe"
"C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe"
"C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe"
Has anyone seen this before?
EDIT: Tried using the command start
, but this opens both files in the same instance. How can I open them in multiple instances?
start /d "R:\Other Stuff\Name" test_excel_1.xlsx
start /d "R:\Other Stuff\Name" test_excel_1.xlsx
EDIT 2:
R is a shared drive; this opens multiple instances of Excel but cannot find files. Do I need to modify my network drives? But I was able to open them using a command start /d
that puzzles me a little.
@echo off
setlocal EnableDelayedExpansion
set "excel=C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe"
for %%a in (
"R:\Other Stuff\Name\text_excel_1.xlsx"
"R:\Other Stuff\Name\text_excel_2.xlsx"
) do start "" "%excel%" "%%~a"
Mistake:
'R: \ Other Stuff \ Name \ test_excel_2.xlsx' could not be found. Check spelling or find another path.
Does anyone see something wrong with this? start /d
finds the file, but the code starting with @echo off
does not find the file.
source to share
to open all xlsx
files in the current folder using excel:
for %%a in (*.xlsx) do start "" "%%a"
(for command line use replace each %%a
with %a
)
To open each file in a separate EXCEL instance:
@echo off
setlocal EnableDelayedExpansion
set "excel=C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE"
for %%a in (
"R:\Other Stuff\Name\Document1.xls"
"C:\users\JSNoob\documents\my Passwords.xlsx"
) do start "" "%excel%" "%%~a"
(adapt the excel path to your system and add the files you need)
source to share