Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Triangle or Terror - Arrays, Dlls, and Excel
Message
From
01/09/2000 14:09:09
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
The Triangle or Terror - Arrays, Dlls, and Excel
Miscellaneous
Thread ID:
00411901
Message ID:
00411901
Views:
49
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
Reply
Map
View

Click here to load this message in the networking platform