I have a Excel spreadsheet that calls a DLL created in VFP. In the spreadsheet an array is created from some cells and passed to a procedure in the DLL. When Excel calls the procedure in the DLL Runtime Error number 5 occurrs and that's all it says. Also know that this code works with Excel 2000, but not 97 and the client has Excel 97. What's wrong? Code below:
Excel code
Set oCalcs = CreateObject("m1.m1")
Dim sngMulti(1 To 97, 1 To 5) As String
' Fill array with equipment values.
For intI = 1 To 97
For intJ = 1 To 5
sngMulti(intI, intJ) = Worksheets("equipment").Cells (intI + 6, intJ).Value
Next intJ
Next intI
Call oCalcs.e48((sngMulti()), Range("maint!o7").Value)
**** e48 code in DLL ********
PROCEDURE e48
PARAMETERS xvalue, discount
DECLARE xvalue(97,5)
LOCAL m1ports,x,y,z
x = m1ports(@xvalue)
y = 2.95
z = x*y*((100-discount)/100)
RETURN z
ENDPROC
Thanks for the help,
Jim
Thanks
Jim