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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EbExecuteLine - running more than one line

Status
Not open for further replies.

Niphyr

Programmer
Jul 21, 2003
85
AU
My problem is i can execute one line of code using:

'*************************************
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

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
'*************************************[/color blue]

but i cant sem to work out a way to execute more than one lineof code as a whole, eg an if statement. is there eny way this could be donw at run-time using this executeline api, or is there another api for the job?

thanks in advance.

 
Last time when i searched for "EbExecuteLine ", i found posts by strongm, strongly discouraging its use.
 
Yep, in summary the problem is that EBExecuteLine works pretty well in the IDE but not in compiled programs
 
Good to see you back strongm. Hope the holiday went fine and was not too short to enjoy.

Will you be explaining a bit more on EBExecuteLine?
 
Figuired that would be the case but hey, never hurts to ask. You should be realxing whilst on holidays strongm, relaxing......... as far away from a PC as possible :)
enjoy

thanks for the advice guys, i did hear something about using vbscripts in one of the other threads so ill look at that next.

again, ty

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top