Does anyone have experience passing strings to and
returning strings from Excel Spreadsheets?
After creating VB Declare Function statements,
the DLL functions are available to the spreadsheet, but
Excel passes and receives 'Rubbish' from the function.
In contrast, the function works fine from the Immediate window
of VBA inside Excel.
There seems to be a difference between the VBA to DLL
'connection' and the Spreadsheet to DLL 'connection'.
Ideas?
Thanks
David
EXAMPLE:
In VBA Module:
Declare Function sdMJDx Lib "sdsun.dll" Alias "sdMJDx" (ByVal Yearx As Long, ByVal Month As Long, ByVal Day As Double, ByVal Hour As Double, ByVal Minute As Double, ByVal Sec As Double, ByVal TimeZone As Double) As String
IN PB DLL
Function sdMJDx Alias "sdMJDx" (ByVal Year As Long, ByVal Month As Long, ByVal Day As Double, ByVal Hour As Double, ByVal Minute As Double, ByVal Sec As Double, ByVal TimeZone As Double) Export As String
Works fine in VBA but return's rubbish from a worksheet.
returning strings from Excel Spreadsheets?
After creating VB Declare Function statements,
the DLL functions are available to the spreadsheet, but
Excel passes and receives 'Rubbish' from the function.
In contrast, the function works fine from the Immediate window
of VBA inside Excel.
There seems to be a difference between the VBA to DLL
'connection' and the Spreadsheet to DLL 'connection'.
Ideas?
Thanks
David
EXAMPLE:
In VBA Module:
Declare Function sdMJDx Lib "sdsun.dll" Alias "sdMJDx" (ByVal Yearx As Long, ByVal Month As Long, ByVal Day As Double, ByVal Hour As Double, ByVal Minute As Double, ByVal Sec As Double, ByVal TimeZone As Double) As String
IN PB DLL
Function sdMJDx Alias "sdMJDx" (ByVal Year As Long, ByVal Month As Long, ByVal Day As Double, ByVal Hour As Double, ByVal Minute As Double, ByVal Sec As Double, ByVal TimeZone As Double) Export As String
Works fine in VBA but return's rubbish from a worksheet.
Comment