Page 1 of 1
Excel Open Document
Posted: Mon Jul 13, 2015 9:47 pm
by m1ngle
Hello;
I'm stymied by a simple question. When I run the task "Excel Open document", it does not seem to do anything. The output window tells me the file has been opened successfully, but the file does not appear. I have checked and unchecked the "Hide Excel application" check box. When the box is unchecked, I briefly see the file open and then close. When it is checked, I do not see anything happen. I am not sure what I am missing here. Apologies for the basic question.
Re: Excel Open Document
Posted: Tue Jul 14, 2015 12:48 pm
by Oleg
You will see nothing if you create the task with only one step (
Excel Open Document)
When the task has finished RoboTask closes opened document.
You have to do something with opened documents:
-
read cells
-
write cells
-
save document
- something others.
Re: Excel Open Document
Posted: Tue Jul 14, 2015 5:52 pm
by m1ngle
Thank you again for your help. I'm trying to save the first worksheet only of a workbook and convert it to CSV. I can do this using a macro and keyboard shortcuts, but the workbook needs to be open when I run commands:
Open Excel Document
Send keys to current window
It appears to run successfully but there is no change in the document.
Re: Excel Open Document
Posted: Wed Jul 15, 2015 12:43 pm
by Oleg
Open Excel Document
Send keys to current window
In this case use
Run Program/Open Document action
then - some pause
Send your keystroke to active window
See the example below. It opens the Excel document and send keystrokes
Alt-F and
A keys ("
save as" operation)
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1639840329
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1291"
Hide=INTEGER|0
ID=INTEGER|1382335971
LogOnAsUser=INTEGER|1
Name=STRING|"Open Excel doc and send keystroke"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
[Actions\Action1]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""MyFile.xls """
Params=FOLDER
[Actions\Action1\Params]
ifnonzero=STRING|"0"
program=STRING|"C:\orders\MyFile.xls"
runas=STRING|"0"
wait=STRING|"0"
[Actions\Action2]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 1 sec"
Params=FOLDER
[Actions\Action2\Params]
delay=STRING|"1"
dimension=STRING|"1"
[Actions\Action3]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER
[Actions\Action3\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"0"
keylayout=STRING|"0"
keys=STRING|"%(F)A"
pause=STRING|"20"
release=STRING|"0"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.