The purpose of this article is to point out one resolution for the Number Out Of Range Error
The main reason this occurs is because the size of the data doesn't fit within the range provided by the program and the database. In this case, it is related to the range of the Array/memory within the program itself, and the number of records the program is expecting.
This occurs because there is an extra line on the invoice, but you can't see it. Click on the first blank line on the invoice and click SHIFT + F2. Confirm this by pressing enter on, or clicking yes when asked to confirm if you want to delete the line. This will remove the line from the invoice and resolve the issue.
PLEASE NOTE: This is one of many reasons as to why this error comes up. "Number Out of Range" errors need to be treated on a case-by-case basis.