I have two versions of excels(2010 and 2016) installed on my machine. I would like to run a vbscript on excel 2016.
only creates excel 2010. How can i change this to 2016?
I believe the issue you may be running into is of 32bit and 64bit.
32bit: c:\Windows\SysWOW64\wscript.exe 64bit: c:\Windows\System32\wscript.exe
When you run a 32bit vbscript process (the default) the mapping automatically takes the 32bit excel version.
So you should try running it with the 64bit VBScript
And yes you would want to use
For 2016, you could try
However, see the comments below as this is not guaranteed to work for recent versions. This has worked for me before for versions up-to and including 2010.
Note that earlier versions don’t have such a straightforward correspondence, 2016 => 16. For example, I believe Office 2010 => 14.