Hi,
Got some code in Excel that retrieves a variable from a database. Subsequently I update the database with a new value and then needs to trigger another update function contained in a DLL. The function requires 2 parameters (eg. ‘Ticker’ and ‘time period’). ‘Ticker’ are retrieved from the database and time period are always ‘DATE’.
So from within Excel I need to send a line that in a command prompt looks like this:
‘rundll32.exe somedll.dll UpdateFunction Parameter1 Parameter2’
Typing this directly in a command prompt works fine. From a lot of reading I’ve seen various suggestions, but haven’t been able to find one that does exactly what I
need…
My function so far is something like this…
Function RunUpdate(ByRef Ticker As String) As Boolean
Dim oShell
Dim WScript As Object
Dim Date$
Date = Date
Set WScript = CreateObject(“WScript.Shell”)
oShell = WScript.Run(“cmd /K ‘rundll32.exe somedll.dll UpdateFunction Ticker Date”,1)
Debug.Print oShell
RunUpdate = True
Set WScript = Nothing
End Function
However this function does not update…
I expect that part of the problem is that the parameters are within the string sent to the command prompt.
Does anyone know how this is ‘normally’ achieved?
(I believe calling an outside dll with variable parameters must be something others do often…)
THX