Question : Detect an application instance.

We currently have a simple batch file which when kicked off by the user opens an Excel spreadsheet in a new instance of Excel. The user requirement is to open that file in an existing instance of Excel (it makes it easier for users to copu/paste from one to the other).

Can this be done from a batch file, or do we need to switch a VBScript?

Answer : Detect an application instance.

That's not a problem.... Try the rest of the code for now and see if that does the trick...

Alternatively, where the user opens his excel (most likely by clicking a shortcut link to it) edit the shortcut's properites to include the '/e' switch on the command line. At that point, you could also add additional switches including the documents' working folders (always handy) as well as specifying the working directory in the shortcut too.

So for now, leave out the following line

   "%programfiles%\microsoft office\office12\excel.exe /e"

and try opening files by referencing just the files themselves.
Random Solutions  
 
programming4us programming4us