T
tedy
Hi there,
Im trying to work out how to use MMult function in the VBA (i dont want
input or output in excel worksheet). But it keeps giving me a runtime
error 1004: "Unable to get the MMult property of the WorksheetFunction
class" on the MMult line.
The funny thing is when i tried changing the array2 into the exact same
dimensions, 2 by 2, it works... this i dont understand, i thought as
long as you have the same number columns in array 1 with the same
number of rows in array 2 it should work.
I really need to have array1 and thus array1inv in 2 by 2, where as
array 2 in 1 by 2.
here is the sub i was working on
Sub test()
Dim array1(1 To 2, 1 To 2) As Single
Dim array1inv
Dim array2(1 To 2) As Single
Dim arrayresult
array1(1, 1) = 0.5
array1(1, 2) = 0.8
array1(2, 1) = 2
array1(2, 2) = 1.2
array2(1) = -5000
array2(2) = -8000
array1inv = Application.WorksheetFunction.MInverse(array1())
arrayresult = Application.WorksheetFunction.MMult(array1inv, array2)
End Sub
ANy help will be much appreciated!
Im trying to work out how to use MMult function in the VBA (i dont want
input or output in excel worksheet). But it keeps giving me a runtime
error 1004: "Unable to get the MMult property of the WorksheetFunction
class" on the MMult line.
The funny thing is when i tried changing the array2 into the exact same
dimensions, 2 by 2, it works... this i dont understand, i thought as
long as you have the same number columns in array 1 with the same
number of rows in array 2 it should work.
I really need to have array1 and thus array1inv in 2 by 2, where as
array 2 in 1 by 2.
here is the sub i was working on
Sub test()
Dim array1(1 To 2, 1 To 2) As Single
Dim array1inv
Dim array2(1 To 2) As Single
Dim arrayresult
array1(1, 1) = 0.5
array1(1, 2) = 0.8
array1(2, 1) = 2
array1(2, 2) = 1.2
array2(1) = -5000
array2(2) = -8000
array1inv = Application.WorksheetFunction.MInverse(array1())
arrayresult = Application.WorksheetFunction.MMult(array1inv, array2)
End Sub
ANy help will be much appreciated!