Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleExecute a line of code stored in a string
Keywordsexecute line, VBA, vba6.dll, vba5.dll, vba332.dll
CategoriesSoftware Engineering
 
Thanks to Sergio Perciballi.

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)) = 0
End Function

Private Sub Command1_Click()
    Dim res As Boolean
    res = FExecuteCode(Text1.Text)
    Label1.Caption = "Status = " & res
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated