|
-
Nov 21st, 2000, 06:43 PM
#1
Thread Starter
Good Ol' Platypus
I've seen it somewhere before;
You can execute a line of VB code from a string somehow...
Like: VBExecute("msgbox 'This is a user generated dialog'")
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 21st, 2000, 11:38 PM
#2
Hyperactive Member
yeah i've seen someone put that code on the forums ... i'm pretty sure it was a guru or someone with at least 2000 posts ... so u should do a search for guru people
-
Nov 22nd, 2000, 01:54 AM
#3
Fanatic Member
Use the Microsoft Scripting Host. It comes with an activex control that you can use in vb. I don't remember how to use it, but it's something like controlname.execute.
-
Nov 22nd, 2000, 06:46 AM
#4
Away with scipting.. Try this:
Code:
Private Declare Function EbExecuteLine Lib "vba6.dll" (ByVal pStringToExec As Long, ByVal Foo1 As Long, ByVal Foo2 As Long, ByVal fCheckOnly As Long) As Long
' = = = = For VB5
'Declare Function EbExecuteLine Lib "vba5.dll" (ByVal pStringToExec As Long, ByVal Foo1 As Long, ByVal Foo2 As Long, ByVal fCheckOnly As Long) As Long
' = = = = For Access 97/VBE.dll clients as Word 97 and Excel 97
'Declare Function EbExecuteLine Lib "vba332.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
Private Sub Form_Load()
Dim TheString As String
TheString = "MsgBox ""This is a user generated dialog"""
Debug.Print FExecuteCode(TheString, False)
End Sub
Enjoy!
-
Nov 22nd, 2000, 10:55 PM
#5
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|