Excel Formulae, VBA & PB DLL - SOLVED!!!
Posted: Wed Jun 03, 2009 2:15 pm
Hi All,
Have recently resurrected an old project to build a DLL of commands in PB that can be accessed by Excel Formulae & VBA...
Problem I'm having is in passing Variables from My Excel Formulae, the MessageRequester Gadget is showing that only the first character of each parameter is being passed?!?!?!?!
Am using Excel2003 on WinXP & PB4.3
ASCII representaqtion of MessageRequester window
I've also discovered that VBA seems to be ASCII based while Excel is UTF-8 which means you have to Compile the PB source accordingly...
Excel Formula
VBA Code
PB Code
Have recently resurrected an old project to build a DLL of commands in PB that can be accessed by Excel Formulae & VBA...
Problem I'm having is in passing Variables from My Excel Formulae, the MessageRequester Gadget is showing that only the first character of each parameter is being passed?!?!?!?!
Am using Excel2003 on WinXP & PB4.3
ASCII representaqtion of MessageRequester window
Code: Select all
+------------------+
|PB INFO | X |
+------------------+
|C |
|S |
|K=V |
| |
| [ OK ] |
+------------------+
Excel Formula
Code: Select all
=SetINIvalue("C:\CPU Data.ini","Section","Key","Value")
Code: Select all
Public Declare Function SetINIvalue Lib "c:\NAWPBXL.dll" (ByVal INIFILE As String, ByVal INIgroup As String, ByVal INIkey As String, ByVal INIvalue As String) As String
Code: Select all
ProcedureDLL.l SetINIvalue(INIfile.s, INIgroup.s ,INIkey.s, INIvalue.s)
MessageRequester("PB INFO", INIfile+Chr(13)+INIgroup+Chr(13)+INIkey+"="+INIvalue)
OpenPreferences(INIfile.s)
PreferenceGroup(INIgroup.s)
ProcedureReturn SysAllocString_(WritePreferenceString(INIkey.s, INIvalue.s))
EndProcedure