I am trying to execute a line of code using a variable. for example
picture1.visible = true picture1 being a variable. the code below is not mine but copied from another forum of sample codes but it more clearly shows the type of
code I'm using. this works in design time but if I make an executable file and run the executable from the same pc and directory I get an error message 53 can not find vba5.dll.
Do I need to do something with vba5.dll which is on my pc?
Use the EbExecuteLine API function in vba6.dll, vba5.dll, or vba332.dll.
Function FExecuteCode(stCode As String, Optional fCheckOnly _ As Boolean) As Boolean FExecuteCode = EbExecuteLine(StrPtr(stCode), 0&, 0&, _ Abs(fCheckOnly)) = 0End FunctionPrivate Sub Command1_Click() Dim res As Boolean res = FExecuteCode(Text1.Text) Label1.Caption = "Status = " & resEnd Sub I have an existing project with code below which works ok but dont understand itPrivate Declare Function EbExecuteLine Lib "vba5.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
Dim retval As Long If boolCheckFileAccess("c:\Exchanges\" & filename & ".txt", "Read") Then
retval = Shell(note_pad_route & " " & "c:\Exchanges\" & filename & ".txt", 1)
Else
Call MsgBox("File - " & filename & " does not exist", vbOKOnly, "Missing File")
End If
End Function any help will be appreciatedthanks
picture1.visible = true picture1 being a variable. the code below is not mine but copied from another forum of sample codes but it more clearly shows the type of
code I'm using. this works in design time but if I make an executable file and run the executable from the same pc and directory I get an error message 53 can not find vba5.dll.
Do I need to do something with vba5.dll which is on my pc?
Use the EbExecuteLine API function in vba6.dll, vba5.dll, or vba332.dll.
Function FExecuteCode(stCode As String, Optional fCheckOnly _ As Boolean) As Boolean FExecuteCode = EbExecuteLine(StrPtr(stCode), 0&, 0&, _ Abs(fCheckOnly)) = 0End FunctionPrivate Sub Command1_Click() Dim res As Boolean res = FExecuteCode(Text1.Text) Label1.Caption = "Status = " & resEnd Sub I have an existing project with code below which works ok but dont understand itPrivate Declare Function EbExecuteLine Lib "vba5.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
Dim retval As Long If boolCheckFileAccess("c:\Exchanges\" & filename & ".txt", "Read") Then
retval = Shell(note_pad_route & " " & "c:\Exchanges\" & filename & ".txt", 1)
Else
Call MsgBox("File - " & filename & " does not exist", vbOKOnly, "Missing File")
End If
End Function any help will be appreciatedthanks
