How to add task between applications??

Discuss RoboTask here
Post Reply
edusa2ooo
Posts: 1
Joined: Mon Jul 29, 2019 4:55 am

How to add task between applications??

Post by edusa2ooo »

I have to edit an excel file and delete some columns, but I cannot find the right commands nor using mouse strokes as it doesn't remember the position.

Thanks.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: How to add task between applications??

Post by Oleg »

Excel actions can get cells from Excel document or put some data to Excel document
If you want to do some advanced actions you have top use VB script and learn Excel object structure

Look at my example please (see below)
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1075658632
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task613"
Hide=INTEGER|0
ID=INTEGER|927607580
LogOnAsUser=INTEGER|1
Name=STRING|"Delete column"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER

[Actions\Action1]
ActionID=STRING|"A_SCRIPT_VBSCRIPT"
Enabled=INTEGER|-1
Name=STRING|"VB Script"
Params=FOLDER

[Actions\Action1\Params]
expandvars=STRING|"0"
line00000000=STRING|"Sub DeleteColumn(clmn)"
line00000001=STRING|"    set app = CreateObject(""Excel.Application"")"
line00000002=STRING|"    app.Visible = true"
line00000003=STRING|"    set book = app.workbooks.Open(""C:\Users\olegyershov\Documents\test.xls"")"
line00000004=STRING|"    'Messagebox(""Press OK"")"
line00000005=STRING|"    app.Columns(clmn +"":""+clmn).Select"
line00000006=STRING|"    app.Selection.Delete Shift=xlToLeft"
line00000007=STRING|"    'Messagebox(""Press OK"")"
line00000008=STRING|"    book.save"
line00000009=STRING|"    app.quit"
line0000000A=STRING|"End Sub"
line0000000C=STRING|"DeleteColumn(""E"")"
linecount=STRING|"14"
savescript=STRING|"0"
the script is

Code: Select all

Sub DeleteColumn(clmn)
    set app = CreateObject("Excel.Application")
    app.Visible = true
    set book = app.workbooks.Open("C:\Users\olegyershov\Documents\test.xls")
    app.Columns(clmn +":"+clmn).Select
    app.Selection.Delete Shift=xlToLeft
    book.save
    app.quit
End Sub

DeleteColumn("E")
Oleg Yershov
Post Reply