Just to continue from the cross post at OzGrid...
"My" code was simply a demonstration of what could be done... not a complete working solution. Plus, the 'language' (as such) is VB script not a DOS batch file.
Copying that code into a batch file will result in errors simply because it is being processed as a batch file and not a VBS file. GetObject, for example, is not a valid internal (external, operable program or batch file) command in DOS.
As regards approaching API experts for your solution, I would have been quite willing to help you to develop an VBS/API based solution if that would have been a suitable approach but your emphasis on 'my' code not working was a little off-putting.
Just out of interest, I am a C++/C#, Assembler programmer, oh, and I've used that horrible Visual Basic extensively in all versions from Visual Studio 2008 all the way back to Visual Basic Version 1.0 in 1991 - so I have a reasonable knowedge of the Windows API). I hang around the Ozgrid board to gain an appreciation of the Excel user functionality like formulas and stuff like that.