I am not an expert on Applescript, in fact I wrote my one script with help from people on here about 2 years ago and haven’t written any since. I had problems with it at the end of last year when I found out that Numbers 3 did not support Applescript, but reverting back to Numbers09 solved the problem until today. Now when I run the script against my Numbers09 files I get the following message
error “Numbers09 got an error: Can’t set sheet "Account" of document 1 to "".” number -10006 from sheet “Account” of document 1
and the line
set value of cell rowcount of column colcount to “”
is highlighted.
This has worked fine up until now has something changed or am I missing something?
ElBeardo
global termind
set termind to 0
run ReconPart1
run ReconPart2
if termind is equal to 0 then
run ReconPart3
run ReconPart4
end if
script ReconPart1
-- Routine Clears Reconciliation Table and Sets Up Opening Balances
tell application "Numbers09"
tell document 1
tell table "AccountTable" of sheet "Account"
set rowcount1 to 4 --Account Table Opening Balance Row
set rowcount2 to 4 -- Reconciliation Table Opening Balance Row
set colida to 1 --"A"
set colide to 5 --"E"
set colidf to 6 --"F"
set colidg to 7 --"G"
set colidj to 10 --"J"
set colidn to 14 --"N"
set colido to 15 --"O"
set colidp to 16 --"P"
set firstrow1 to 5 -- First Transaction Row Account Table
set lastrow1 to 50 -- Last Transaction Row Account Table
set firstrow2 to 5 -- First Transaction Row Reconciliation Table
set lastrow2 to 50 -- Last Transaction Row Reconciliation Table
-- Clear Reconciliation Table
--Set all cells J5:O50 to Null
--Column P contains Formula
repeat with rowcount from firstrow2 to lastrow2
repeat with colcount from colidj to colido
set value of cell rowcount of column colcount to ""
end repeat
end repeat
-- From Account Table Pick Up Opening Balances
set Balance1 to value of cell rowcount1 of column colide
set Balance2 to value of cell rowcount1 of column colidg
-- Set Up Opening Balances in Reconciliation Table
set value of cell rowcount2 of column colidn to Balance1
set value of cell rowcount2 of column colidp to Balance2
end tell -- AccountTable of Account
end tell -- Document 1
end tell -- Numbers09
end script