View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Med Tom Med is offline
external usenet poster
 
Posts: 27
Default Coring on calling VBA6 dll

I have this bit of code that cores excel. Is there something I am
doing wrong?

Option Explicit


Declare Function EbExecuteLine Lib "C:\Program Files\Common Files
\Microsoft Shared\VBA\VBA6\VBACV20.dll" ( _
ByVal stStringToExec As Long, _
ByVal Unknownn1 As Long, _
ByVal Unknownn2 As Long, _
ByVal fCheckOnly As Long) As Long


Public Function ExecuteLine(stCode As String, Optional bCheckOnly As
Boolean = False) As Boolean
Dim stCommand As String * 256
Dim lgPtr As Long

stCommand = stCode
lgPtr = StrPtr(stCommand)
ExecuteLine = EbExecuteLine(lgPtr, 0&, 0&, Abs(bCheckOnly)) = 0
End Function


Private Sub test1()
ExecuteLine ("15 + 30")
End Sub