Dit is het vervolg van topic '[VBA / Access]Sub uitvoeren vanuit een string'
Ik heb de volgende code:
----------------------------
Declare Function EbExecuteLine Lib "VBACV20.DLL" (ByVal pStringToExec As Long, ByVal Foo1 As Long, ByVal Foo2 As Long, ByVal fCheckOnly As Long) As Long
Function FExecuteCode(stCode As String, Optional fCheckOnly As Boolean) As Boolean
FExecuteCode = EbExecuteLine(StrPtr(stCode), 0&, 0&, Abs(fCheckOnly)) = 0
End Function
Sub Test()
Call FExecuteCode("Msgbox(""test"")")
End Sub
----------------------------
Als ik de functie test uitvoer krijg ik de volgende fout:
'Fout 53. Kan het volgende bestand niet vinden: VBACV20.DLL'
Ik heb de dll wel op de PC staan (C:\Program Files\Common Files\Microsoft Shared\VBA\VBACV20.DLL).
Deze staat geregisteerd in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs.
Weet iemand wat ik hier fout doe?
Ik heb de volgende code:
----------------------------
Declare Function EbExecuteLine Lib "VBACV20.DLL" (ByVal pStringToExec As Long, ByVal Foo1 As Long, ByVal Foo2 As Long, ByVal fCheckOnly As Long) As Long
Function FExecuteCode(stCode As String, Optional fCheckOnly As Boolean) As Boolean
FExecuteCode = EbExecuteLine(StrPtr(stCode), 0&, 0&, Abs(fCheckOnly)) = 0
End Function
Sub Test()
Call FExecuteCode("Msgbox(""test"")")
End Sub
----------------------------
Als ik de functie test uitvoer krijg ik de volgende fout:
'Fout 53. Kan het volgende bestand niet vinden: VBACV20.DLL'
Ik heb de dll wel op de PC staan (C:\Program Files\Common Files\Microsoft Shared\VBA\VBACV20.DLL).
Deze staat geregisteerd in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs.
Weet iemand wat ik hier fout doe?