LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default call sub

Hi!
I wrote the code I pasted at the end of the mail to call a
sub from a dll file. Apparently the code looks correct to
me but instead of returning the correct value of z it
gives me only zeros. Does someone of you see any mistake
for example in the use of the call sub? Thank you
Here is the code:

Declare Sub asum Lib "D:\Dll\arr\koedll.dll" (x As Double,
y As Double, z As Double, n As Integer)
Sub koelarr()
'
' koelarr Macro
' Macro written 10/3/2003 by Claudia Dell'Era Try to link
an array
'

'
Dim x() As Double, y() As Double, z() As Double
Dim n As Integer, i As Integer

Worksheets("Sheet2").Activate
n = Cells(2, 4)

ReDim x(1 To n) As Double, y(1 To n) As Double, z(1 To
n) As Double

Worksheets("Sheet2").Activate
For i = 1 To n
x(i) = Cells(i + 1, 1)
Next i

For i = 1 To n
y(i) = Cells(i + 1, 2)
Next i

Call asum(x(1), y(1), z(1), n)

For i = 1 To n
Cells(i + 1, 3) = z(i)
Next i

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wouldn't know what to call it! 1Fish2Fish Excel Worksheet Functions 5 August 26th 08 07:37 PM
Is there a do not call function? pokdbz Excel Discussion (Misc queries) 2 December 27th 07 04:00 PM
I'm not sure what you'd call it, but is it possible to do this? nut_mom Excel Discussion (Misc queries) 3 June 28th 06 06:17 PM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
Don't know what to call what I need? chanwando Excel Worksheet Functions 5 September 9th 05 10:01 PM


All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"