The Problem is an excel file on a network drive which is to be opened from a .cmd file in the same folder. As I'd rather not tamper with the registry on a machine at work, I used the pushd command to switch to the directory and open the file. Unfortunately pushd maps the path to a temporary drive letter which usually does not exist anymore when I save the excel file. Of course I could just use save-as and select the network path, yet it is rather tedious doing this on a daily basis.
Question(s):
Is there a way to circumvent the drive letter mapping and open the excel file from cmd on the network path without touching the registry?
Or, which seems more probable, is there a way to change the saving path of the excel file automatically to the required network path? I assume you could change some variable onWorkbookOpen, yet I don't know which...
Just in case, here's the batch code...
pushd \\%~P0
START excel.xlsm