R
robo87
Hello there,
I'm new to applescript so it might sound silly.
I've got problem with pasting from one document (source) to another (target)
different columns. The nightmare begins when code is getting to the part when
it needs to go to the next column and copy it and it just doesn't want to
copy or paste it.
tell application "Microsoft Excel"
activate
open source
activate object workbook source
select range "I:I" of sheet 1 of workbook source
copy range (range "I:I" of sheet 1 of workbook source)
open target
activate object workbook target
select (range "B2")
paste worksheet sheet 1 destination range "B2:B" of workbook target
delay 2
set the clipboard to ""
activate object workbook source
activate object sheet 1
select range "A:A" of sheet 1 of workbook source
copy range (range "A:A" of sheet 1 of workbook source)
activate object workbook target
activate object sheet 1
select (range "D2")
paste worksheet sheet 1 destination range "D2" of workbook target
delay 2
set the clipboard to ""
end tell
Maybe there's solution for doing that in a different way?
Thanks in advance
Robo
I'm new to applescript so it might sound silly.
I've got problem with pasting from one document (source) to another (target)
different columns. The nightmare begins when code is getting to the part when
it needs to go to the next column and copy it and it just doesn't want to
copy or paste it.
tell application "Microsoft Excel"
activate
open source
activate object workbook source
select range "I:I" of sheet 1 of workbook source
copy range (range "I:I" of sheet 1 of workbook source)
open target
activate object workbook target
select (range "B2")
paste worksheet sheet 1 destination range "B2:B" of workbook target
delay 2
set the clipboard to ""
activate object workbook source
activate object sheet 1
select range "A:A" of sheet 1 of workbook source
copy range (range "A:A" of sheet 1 of workbook source)
activate object workbook target
activate object sheet 1
select (range "D2")
paste worksheet sheet 1 destination range "D2" of workbook target
delay 2
set the clipboard to ""
end tell
Maybe there's solution for doing that in a different way?
Thanks in advance
Robo