Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime Error 53

Status
Not open for further replies.

takyan

Programmer
Oct 16, 2002
84
HK
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

 
I don't know if this helps, but there was a bug in VBA6.DLL in (I think) SP2 or SP3.

Check that you are up to SP5, which has certainly cured the original problems.
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
The VB directory (which is where the dll is probably located) is probably not in your system's path. No problem when running in design time, as it's already loaded in the process of VB. However, if your compiled executable is NOT in the same directory as VB, it can't find the dll....
Greetings,
Rick
 
I'll repeat what I've said many times before: EbExecuteLine is ONLY stable in the IDE; frankly, don't use it in programs you ever intend to compile.
 
If this is the case then is there any other way of getting a Eval type command working as requested by Takyan.
 
I found the same thing. runtime 53. so I copied vba6.dll to sys32 and tried to reg it, only I got the following error message: "vba6.dll was loaded, but the DllRegisterServer entry point was not found. DllRegServ may not be exported, or a corrupt version of vba6.dll may be in memory."

now I consistantly get Dr. Watson popping up.

It may just be easier and more relable to go with a less eligate case statement, not nearly as cool and flexible, but it'll work.

-Rick
 
>>so I copied vba6.dll to sys32 and tried to reg it, only I got the following error message: "vba6.dll was loaded, but the DllRegisterServer entry point was not found. DllRegServ may not be exported, or a corrupt version of vba6.dll may be in memory."

You get this error because it's probably a plain dll. These kind of dll's don't need registration (i.e. can't be registered).

Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top