ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calling VBA from EXCEL (https://www.excelbanter.com/excel-programming/405414-calling-vba-excel.html)

LesHurley

calling VBA from EXCEL
 
I have a VBA procedure Aug that augments one matrix with another as in Aug(M,b)
M b

1 2 3 2 1
3 2 1 3 4
4 1 0 4 1

A

1 2 3 2 1
3 2 1 3 4
4 1 0 4 1

Then I can call another of my VBA procedures, Canform(A) which calculates
the canonical form of A as in

C

1 0 0 1.125 -0.875
0 1 0 -0.5 4.5
0 0 1 0.625 -2.375

This also works fine.
I think I should call them serialy as =canform(aug(M,b)) and get the same
result. What I get is an error message that says "A value used in the
formula is of the wrong data type.

What's wrong with this?

--
Thanks for your help

Leith Ross[_2_]

calling VBA from EXCEL
 
On Jan 31, 4:00 pm, LesHurley
wrote:
I have a VBA procedure Aug that augments one matrix with another as in Aug(M,b)
M b

1 2 3 2 1
3 2 1 3 4
4 1 0 4 1

A

1 2 3 2 1
3 2 1 3 4
4 1 0 4 1

Then I can call another of my VBA procedures, Canform(A) which calculates
the canonical form of A as in

C

1 0 0 1.125 -0.875
0 1 0 -0.5 4.5
0 0 1 0.625 -2.375

This also works fine.
I think I should call them serialy as =canform(aug(M,b)) and get the same
result. What I get is an error message that says "A value used in the
formula is of the wrong data type.

What's wrong with this?

--
Thanks for your help


Hello LesHurley,

You need to show the VBA code for both procedures: Aug(M,b) and
Canform(), before anyone can answer your question.

Sincerely,
Leith Ross

LesHurley

calling VBA from EXCEL
 
Thanks for the reply, Leith. I wouldn't mind sending the code but that's
quite a bit of code to display in the small window we have available.
Canform() itself has about 75 lines, and it calls two other function
procedures, all together about 150 lines of code. Aug() is smaller, about 35
lines. I think I will write two much simpler test routines and see if I can
successfully do the same thing with them. If not, the group will here from
me again.
Thanks for your help


"Leith Ross" wrote:

On Jan 31, 4:00 pm, LesHurley
wrote:
I have a VBA procedure Aug that augments one matrix with another as in Aug(M,b)
M b

1 2 3 2 1
3 2 1 3 4
4 1 0 4 1

A

1 2 3 2 1
3 2 1 3 4
4 1 0 4 1

Then I can call another of my VBA procedures, Canform(A) which calculates
the canonical form of A as in

C

1 0 0 1.125 -0.875
0 1 0 -0.5 4.5
0 0 1 0.625 -2.375

This also works fine.
I think I should call them serialy as =canform(aug(M,b)) and get the same
result. What I get is an error message that says "A value used in the
formula is of the wrong data type.

What's wrong with this?

--
Thanks for your help


Hello LesHurley,

You need to show the VBA code for both procedures: Aug(M,b) and
Canform(), before anyone can answer your question.

Sincerely,
Leith Ross



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

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