Hello,
I am trying to align to right the text I transfer from one workbook to another but can’t get the script to work!
Can anyone help in the matter?
Here is the error message
Result:
error “Microsoft Excel got an error: Can’t set alignment of cell "W6" of active sheet of workbook 1 to right.” number -10006 from alignment of cell “W6” of active sheet of workbook 1
and here is my script
tell application "Microsoft Excel"
set sourceBook to active workbook
set destinationBook to first workbook
set sourceRange to get range "AF6" of active sheet of sourceBook
set destinationRange to get range "W6" of active sheet of destinationBook
set value of destinationRange to (get value of sourceRange)
set alignment of destinationRange to right
end tell
Any help is appreciated
Thanks