Note that there are some explanatory texts on larger screens.

plurals
  1. POunable to get the MMult property of the WorksheetFunction
    text
    copied!<p>everyone, I got a strange problem, please help.</p> <p><strong>the error message is:</strong> </p> <blockquote> <p>Run-time error '1004'</p> <p>Unable to get the <code>MMult</code> property of the <code>WorksheetFunction</code> class</p> </blockquote> <p>1, I use a program name is "<code>schedule</code>" to automaticly run my VBA program everyday, but the VBA program will fail everyday, but when I control my "schedule program" to automatically run it again to try to reproduce this error, I can't get it, it run smooth.</p> <p>2, When this error occured, Excel will show <strong>[end] [debug]</strong> window, I click <strong>[debug]</strong> and press <strong>[F5]</strong>, it run smooth; it supposes show error again if parameters for MMult are incorrect.</p> <p>3, I have written a sub to dump my data which use in <code>mmult</code>, it are same in error occur and no error.</p> <p>so, I can assume the two parameters for <code>mmult</code> are correct, but why I got the error message everyday?</p> <p><strong>this most hard thing is it is hard to reproduce this error.</strong> </p> <p><strong>code:</strong></p> <pre><code>Public Function Regression(ByVal X As Variant, ByVal y As Variant) writelog ("Regression") writelog ("dump x") Call dumpRange(X, 2) writelog ("dump y") Call dumpRange(y, 1) Dim xtrans, temp, temp2, b xtrans = Application.WorksheetFunction.Transpose(X) temp = Application.WorksheetFunction.MMult(xtrans, X) ' occour error on this line temp = Application.WorksheetFunction.MInverse(temp) temp2 = Application.WorksheetFunction.MMult(xtrans, y) b = Application.WorksheetFunction.MMult(temp, temp2) Regression = b End Function </code></pre> <p>X is a Range like this</p> <pre><code>1 0.34343323 1 1.32323323 1 1.21111221 1 0.33444232 . ...... </code></pre> <p>Window 7 home preminum 64bit</p> <p>office 2010 professional 64bit / 32bit sp1</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload