How to open new instance of an excel file from batch?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
BGMAXMAN
Posts: 3
Joined: 25 Apr 2014 15:38

How to open new instance of an excel file from batch?

#1 Post by BGMAXMAN » 25 Apr 2014 15:41

I currently have the batch file below. It checks the server's file and if its newer it copies the hidden/read only excel file to the local computer.

Code: Select all

set "source=\\server\excelfile.xlsm"
set "target=C:\excelfilefolder\"

xcopy "%source%" "%target%" /y /d /h /k /r

START "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.exe" "%target%\excelfile.xlsm"
EXIT


The problem is I want it to open a new instance of excel when it starts up. If I have any excel file already open, it attaches itself to that instance.
This will be running on Windows 7/Excel 2010. I googled and tried adding %1, /e, all kinds of things and none worked, any ideas?


BGMAXMAN
Posts: 3
Joined: 25 Apr 2014 15:38

Re: How to open new instance of an excel file from batch?

#3 Post by BGMAXMAN » 25 Apr 2014 16:24

Thanks for the response, but this is not a solution that works for me (i did see it already as I did search). I do not wish to modify registry values and the like as this will be deployed across multiple computers on my work network and that is not an option.

I was looking for a command that maybe I was missing from my batch file that could accomplish this...

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: How to open new instance of an excel file from batch?

#4 Post by Squashman » 25 Apr 2014 16:26

Well that is what Group Policy is for!

But I did use the /e option on Office 2007 and it works. And from what I have read on the Web it works on Office 2010 as well.

Code: Select all

start "" "C:\Program Files (x86)\Microsoft Office\Office12\excel.exe" /e "Q2 2014 Drop Schedule 4-24-14.xlsx"
start "" "C:\Program Files (x86)\Microsoft Office\Office12\excel.exe" /e "Q3 2014 Drop Schedule 4-24-14.xlsx"


http://social.technet.microsoft.com/For ... orum=excel

BGMAXMAN
Posts: 3
Joined: 25 Apr 2014 15:38

Re: How to open new instance of an excel file from batch?

#5 Post by BGMAXMAN » 25 Apr 2014 16:47

Squashman you squashed it! I was not using /e correctly in my syntax, thanks, it works great!

Post Reply