Reading data dll into excel

I have recompiled a Visual Foxpro table into a DLL using VFP9. It is registered and VFP reads the DLL correctly. The DLL is just a table with code that performs a lookup based on two values and returns a value for use.

In Excel, the following code is in a module:

Declare Function spec_Field_Value_Function Lib "spec_search" (cThisSize As String, cThisValue As String)

Public Function spec(Shape As String, Property As String) As Variant

Dim SteelSearch As New spec_search.spec_Field_Value

spec = SteelSearch.spec_Field_Value_Function(Shape, Property)

End Function

In a spreadsheet, text is placed in two different cells and the call is "=spec(a1,b1) which is supposed to place a value in the cell. When the DLL was originally compiled in Visual Foxpro 6, the code above worked. Now it doesn't work with the new DLL. Can anyone see anything wrong with the coding above

Is there any way to view what is being passed between Excel and the DLL  

Any pointers are appreciated. 



Answer this question

Reading data dll into excel

  • Martin Hansen

    The error is that I can only get a #VALUE! in the cell where the value from the DLL should be placed. The data DLL (Compiled in Visual Foxpro 6) worked perfectly. Compiling the same code in Visual Foxpro 9 creates a situation where the DLL is not read by VBA in Excel.

    This is the VBA code in Excel:

    Declare Function aisc_field_value_function Lib "aisc_search" _
    (cThisSize As String, cThisValue As String)

    Public Function AISC(Shape As String, Property As String) As Variant

    Dim SteelSearch As Object
    Set SteelSearch = CreateObject("aisc_Field_Value.aisc_Field_Value")

    AISC = SteelSearch.aisc_field_value_function(Shape, Property)

    End Function

    In a spreadsheet, I place one look up value in cell A1, another in cell A2, in a third cell the formula entered is "=AISC(A1, A2)" which call the values I need from the DLL. All I get now is #VALUE!. I checked out the DLL using calls in VFP9 and it works there.

    I am loosing what little hair I have trying to get this to work without resorting to finding VFP 6. It appears that nothing is communicating.


  • GimGif

    The data DLL does not contain any binary-coded information. You can view the contents with a text editor since it is just a table of data.
  • Juan C. Mendez

    Hi,

    Please provide additional details on the error that you get or specifics on what is not working (i.e., how did you know it didn't work).

    -brenda (ISV Buddy Team)



  • Greg Stolecki

    While we await the additional details, here's one general suggestion from the engineer:

    The only way is use windbg to get the binary data in memory…

    I suggest buddy try to invoke this dll in vc++ or vb first. I doubt the com dll generate by vfp9 has problem.

    Unless this helps you resolve this issue, please do send the info that the engineer needs in order to investigate more fully.

    -brenda (ISV Buddy Team)



  • Yannis26

    Thanks for the additional info, I've forwarded it back to the engineer so that he can investigate the issue further.

    -brenda (ISV Buddy Team)



  • Reading data dll into excel