This error may occur in the following situations:
To solve this problem
Use error trapping to detect a singular matrix.
Example
On Error Resume Next
Set B = A.Inverse
If Err.Number = 1306 + vbObjectError Then
'put your error handling code here
Debug.Print "Singular Matrix"
End If