I have a below code, which is opening a Excel file, then a Message box appears and "Y" button is pressed by default SendKey(not by keyboard) and then Excel file is showing the data. After that we are doing Save as Option and saving it as today.xls New file.
Expand|Select|Wrap|Line Numbers
- var myApp = new ActiveXObject("Excel.Application");
- myApp.visible = false;
- var shell = new ActiveXObject("WScript.shell");
- shell.run('"C:\\ROME Literature Spreadsheet.xls"',1);
- WScript.sleep(5000);
- shell.SendKeys("y");
- myApp.ActiveWorkbook.SaveCopyAs("C:\\goon\\today.xls");
- shell.SendKeys("%{F4}");
And in the below code which is doing SaveAs option
myApp.ActiveWorkbook.SaveCopyAs("C:\\goon\\today.x ls");
sometimes if there are Multiple Excel file is opened..it is getting confused and pointing to some other Excel file and it is doing SaveAs option in it
I want to point to "ROME Literature Spreadsheet.xls" only which is opened at that time.
Is it possible?
Thanks in Advance