Added a number box called RecNo as hidden
Added a listbox called LogBox as hidden along with some logic to unhide it and hide it again
I created a common function:
function LogMsg(msg) {
LogBox.addItem(worksheet.RecNo.rawValue + msg); // add record number and message
RecNo.rawValue++; // increment
if (RecNo.rawValue > 20) { // size limit for listbox, pick a favorite number
LogBox.deleteItem(0); // delete top (oldest) entry
}
}
From places in code I want to track if there is a failure:
Script_object.LogMsg("any message");