From: C. Kevin Provance on 17 Jun 2010 17:49 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 Public Function ExecuteLine(sCode As String, _ Optional fCheckOnly As Boolean) As Boolean ExecuteLine = EbExecuteLine(StrPtr(sCode), 0&, 0&, Abs(fCheckOnly)) = 0 End Function Usage: ExecuteLine "var = 3^2 + sin(3.1415926/4):msgbox var" ExecuteLine "shell " & Chr$(34) & "calc.exe" & Chr$(34) & ",vbNormalFocus" ExecuteLine "Form1.BackColor = vbRed" Only works in the IDE, not in compiled EXE. I'd be interested to see if it works in an add-in ::shrugges:: -- Customer Hatred Knows No Bounds at MSFT Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc Bawwk! Paulie want a dingleball, bawwk!
|
Pages: 1 Prev: Sample button bar code crashes VB6 Next: The confused end luser |