This error occurs often when any argument passed to the worksheet function is not of the correct type or simply doesn’t make sense.
For example, I’ve had this problem when calling WorksheetFunction.Asin
with an argument bigger than 1. In your case, I’d guess currentCell.Value
is a non-numeric value or one not according to your region settings regarding numbers.
Yes, the error message is really misguiding.