ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MMult function . Highly frustrating experience please help. (https://www.excelbanter.com/excel-programming/416594-mmult-function-highly-frustrating-experience-please-help.html)

BEETAL

MMult function . Highly frustrating experience please help.
 
With Application

matrixfinal = .MMult(mat1,mat2)

end with

The above programme works in one spreadsheet. The same syntax does not work
in another programme and "type mismatch" error comes as the answer.

What is the way Excel remembers a matrix created by a routine like
mat(1,Q) where q changes from 1 to 7 say. There are 7 elements. mat(1,1) to
mat(1,7). Now this is a row matrix,from the construction.
when I multiply this one with another 7x7 matrix ,by the above .MMult command
the type mismatch comes.

2. Then I tried changing both the matrix to 7X7. Yet again Type mismatch
error comes.

Going on for some time.

Dear MVPs and other experts, please help.

with regards

--
beetal

Barb Reinhardt

MMult function . Highly frustrating experience please help.
 
You may want to check the type throughout your code for matrixfinal, mat1 and
mat2. I've seen problems if a variable is declared one way in one piece of
code, and either differently declared or not declared in other pieces of
code.
--
HTH,
Barb Reinhardt




"BEETAL" wrote:

With Application

matrixfinal = .MMult(mat1,mat2)

end with

The above programme works in one spreadsheet. The same syntax does not work
in another programme and "type mismatch" error comes as the answer.

What is the way Excel remembers a matrix created by a routine like
mat(1,Q) where q changes from 1 to 7 say. There are 7 elements. mat(1,1) to
mat(1,7). Now this is a row matrix,from the construction.
when I multiply this one with another 7x7 matrix ,by the above .MMult command
the type mismatch comes.

2. Then I tried changing both the matrix to 7X7. Yet again Type mismatch
error comes.

Going on for some time.

Dear MVPs and other experts, please help.

with regards

--
beetal


Patrick Molloy[_2_]

MMult function . Highly frustrating experience please help.
 
do you use

OPTION EXPLICIT

as the first line of the code module?

"BEETAL" wrote:

With Application

matrixfinal = .MMult(mat1,mat2)

end with

The above programme works in one spreadsheet. The same syntax does not work
in another programme and "type mismatch" error comes as the answer.

What is the way Excel remembers a matrix created by a routine like
mat(1,Q) where q changes from 1 to 7 say. There are 7 elements. mat(1,1) to
mat(1,7). Now this is a row matrix,from the construction.
when I multiply this one with another 7x7 matrix ,by the above .MMult command
the type mismatch comes.

2. Then I tried changing both the matrix to 7X7. Yet again Type mismatch
error comes.

Going on for some time.

Dear MVPs and other experts, please help.

with regards

--
beetal



All times are GMT +1. The time now is 09:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com