I am assuming you already know about XLSave (or even XLCreate) and have deemed them unsuitable.
This will open output2.xlsx and save it as output3.xlsx
Code: Select all
XLOpen>d:\output2.xlsx,1,xlBook
XLSave>xlBook,d:\output3.xlsx
This will attach to an already open output3.xlsx and save it as output4.xlsx
Code: Select all
XLGet>d:\output3.xlsx,xlBook
XLSave>xlBook,d:\output4.xlsx
If it is a simple Save As dialog, then SetFocus>Save As should work. But as far as I am aware the more recent versions of Excel don't have the traditional Windows Save As window.
Testing with Office 365, and assuming you want to enter something into the "Enter File Name Here" box, I found that although the Find Object Wizard was able to enter the file name, it didn't seem to "register" when we clicked Save.
My workaround was to use UIGetValue to find the positions of the box, click in it, send text, and press enter. The timing below was crucial. Without the small wait, Excel became overwhelmed and the script was unreliable. You may need to increased the waits slightly.
Note that even though we're looking at "Save As", the window name is actually "output2.xlsx - Excel" - and note that some versions of Excel seem to use " - Excel" and some don't - and it's not always visible. The Find Object Wizard will figure this out for you.
Code: Select all
let>sk_delay=50
setfocus>output2.xlsx - Excel
UIGetValue>{"output2.xlsx - Excel"},{"Enter file name here"},curVals,Positions,nHeight
Separate>Positions,comma,Mouse
mousemove>Mouse_1,Mouse_2
Wait>0.1
lclick
Wait>0.1
Send>NewName
Wait>0.1
press enter
...it may also be worth trying Image Recognition.