Excel error 1004 “Unable to get … property of WorksheetFunction class” appearing inconsistently

后端 未结 3 570
攒了一身酷
攒了一身酷 2020-11-30 12:02

I have a VBA function within a spreadsheet which operates on another spreadsheet that is opened in an earlier stage of my macro. The macro used to work fine but just recent

3条回答
  •  情深已故
    2020-11-30 13:02

    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.

提交回复
热议问题