Option Explicit Dim perlProc As WshExec Dim perlIn As TextStream Dim perlOut As TextStream Private Sub Workbook_Open() Dim wsh As New WshShell Set perlProc = wsh.Exec("C:\perl\bin\perl C:\perl\play\wordnet-ipc.pl ") Set perlIn = perlProc.StdIn Set perlOut = perlProc.StdOut End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) perlProc.Terminate End Sub #### Function doQueryWord(aWord As String, aRole as String) As String ' Construct a command in the simple protocol wordnet-ipc expects Dim cmd as String cmd = "word" & ";" & aWord & ";" & aRole ' Send the command to the waiting perl script perlIn.writeLine cmd ' Read the output from the perl script. This will block until output appears. Dim results As String results = perlOut.readLine ' Return results. You could split on commas - not sure what format you need. doQueryWord = results End Function ' doQuerySense would be nearly identical