copy and paste values error
Howdy folks. Need another pair of eye to help push me in the right direction. I’m trying to write an applescript that will copy the value of a formula in one worksheet and paste it into another. cell g7 contains a countif formula. i am trying to get the value of the formula from the annual xlxx and paste it to cell am3 of the payroll xlxx. When I tried to compile the script a, I got an “Expected end of line, etc. but found end of script” error. Can someone please take a look at it and see what I’ve done wrong?
tell application "Finder"
activate
set annual_path to alias "Users:macbook:Desktop:DSHS Reports:DOEP Annual Report:Drug Annual Report.xlsx"
open document file annual_path
set payroll_path to alias":Users:macbook:Desktop:Instructor Payout.xlsx"
open document file payroll_path
tell application "Microsoft Excel"
set annual_book to (open workbook workbook file name (annual_path as string))
set annual_doc to worksheet 2 of annual_book
set payroll to worksheet "sheet1" of (open workbook workbook file name (payroll_path as string))
tell annual_doc
set ben to range "G7"
end tell
tell payroll
set value of cell "AM3" to ben
end tell
save annual_book
close annual_book
save active workbook in payroll_path
close active workbook
end tell