Hi,
Here is the code in one of my form. When i run it from
design time, it is OK. However, when i create a EXE file
and run it, an error msg is prompted, "Run Time Error -
File Not Found (vba6.dll). Please advise.
Option Explicit
Private Declare Function EbExecuteLine Lib "vba6.dll"
(ByVal pStringToExec As Long, ByVal Unknownn1 As Long,
ByVal Unknownn2 As Long, ByVal fCheckOnly As Long) As Long
Private Sub Command1_Click()
Dim strFormName As String
Dim strToExecute As String
strFormName = txtFormName
strToExecute = "Load " & strFormName & " : " & strFormName
& ".Show"
ExecuteLine (strToExecute)
End Sub
Public Function ExecuteLine(sCode As String, Optional
fCheckOnly As Boolean) As Boolean
ExecuteLine = EbExecuteLine(StrPtr(sCode), 0&, 0&, Abs
(fCheckOnly)) = 0
End Function
Yan
Here is the code in one of my form. When i run it from
design time, it is OK. However, when i create a EXE file
and run it, an error msg is prompted, "Run Time Error -
File Not Found (vba6.dll). Please advise.
Option Explicit
Private Declare Function EbExecuteLine Lib "vba6.dll"
(ByVal pStringToExec As Long, ByVal Unknownn1 As Long,
ByVal Unknownn2 As Long, ByVal fCheckOnly As Long) As Long
Private Sub Command1_Click()
Dim strFormName As String
Dim strToExecute As String
strFormName = txtFormName
strToExecute = "Load " & strFormName & " : " & strFormName
& ".Show"
ExecuteLine (strToExecute)
End Sub
Public Function ExecuteLine(sCode As String, Optional
fCheckOnly As Boolean) As Boolean
ExecuteLine = EbExecuteLine(StrPtr(sCode), 0&, 0&, Abs
(fCheckOnly)) = 0
End Function
Yan