Slightly edited the example from the link I sent you. It works. Edit the assignment to the Const.
VBScrollVonPookster.zip
<table width="100%" border="1" bgcolor="White" style="filter
rogid:DXImageTransform.Microsoft.Gradient(endColorstr='#C0CFE2', startColorstr='#FFFFFF', gradientType='0');"><tr><TD><font size="2" face=Courier New> <font color="#0000A0">Option</font> <font color="#0000A0">Explicit</font>
<font color="#0000A0">Private</font> <font color="#0000A0">Const</font> PROCESS_ALL_ACCESS = &H1F0FFF
<font color="#0000A0">Private</font> <font color="#0000A0">Declare</font> <font color="#0000A0">Function</font> OpenProcess <font color="#0000A0">Lib</font> "kernel32" _
(ByVal dwDesiredAccess <font color="#0000A0">As</font> Long, <font color="#0000A0">ByVal</font> bInheritHandle <font color="#0000A0">As</font> Long, _
<font color="#0000A0">ByVal</font> dwProcessId <font color="#0000A0">As</font> Long) <font color="#0000A0">As</font> <font color="#0000A0">Long</font>
<font color="#0000A0">Private</font> <font color="#0000A0">Declare</font> <font color="#0000A0">Function</font> GetExitCodeProcess <font color="#0000A0">Lib</font> "kernel32" _
(ByVal hProcess <font color="#0000A0">As</font> Long, lpExitCode <font color="#0000A0">As</font> Long) <font color="#0000A0">As</font> <font color="#0000A0">Long</font>
<font color="#0000A0">Private</font> <font color="#0000A0">Declare</font> <font color="#0000A0">Function</font> TerminateProcess <font color="#0000A0">Lib</font> "kernel32" _
(ByVal hProcess <font color="#0000A0">As</font> Long, <font color="#0000A0">ByVal</font> uExitCode <font color="#0000A0">As</font> Long) <font color="#0000A0">As</font> <font color="#0000A0">Long</font>
<font color="#0000A0">Private</font> ShellReturnValue <font color="#0000A0">As</font> <font color="#0000A0">Long</font>
<font color="#0000A0">Private</font> <font color="#0000A0">Const</font> VBScrollFullname <font color="#0000A0">As</font> <font color="#0000A0">String</font> = "C:\Documents and Settings\Tom\Desktop\VBScroll.exe"
<font color="#0000A0">Private</font> <font color="#0000A0">Sub</font> Workbook_Open()
ShellReturnValue = Shell(VBScrollFullname)
<font color="#0000A0">End</font> <font color="#0000A0">Sub</font>
<font color="#0000A0">Private</font> <font color="#0000A0">Sub</font> Workbook_BeforeClose(Cancel <font color="#0000A0">As</font> Boolean)
<font color="#0000A0">Call</font> EndShelledProcess
<font color="#0000A0">End</font> <font color="#0000A0">Sub</font>
<font color="#0000A0">Private</font> <font color="#0000A0">Function</font> EndShelledProcess() <font color="#0000A0">As</font> <font color="#0000A0">Boolean</font>
<font color="#008000"> 'PURPOSE: End a process started with VB's Shell Statement</font>
<font color="#008000"> 'INPUT: Task ID returned by Shell</font>
<font color="#008000"> 'RETURNS: True if successful, false otherwise</font>
<font color="#0000A0">On</font> <font color="#0000A0">Error</font> <font color="#0000A0">Resume</font> <font color="#0000A0">Next</font>
<font color="#0000A0">Dim</font> hInst <font color="#0000A0">As</font> <font color="#0000A0">Long</font>
<font color="#0000A0">Dim</font> hProcess <font color="#0000A0">As</font> <font color="#0000A0">Long</font>
<font color="#0000A0">Dim</font> lExitCode <font color="#0000A0">As</font> <font color="#0000A0">Long</font>
<font color="#0000A0">Dim</font> lRet <font color="#0000A0">As</font> <font color="#0000A0">Long</font>
hInst = ShellReturnValue
<font color="#0000A0">If</font> hInst = 0 <font color="#0000A0">Then</font> <font color="#0000A0">Exit</font> <font color="#0000A0">Function</font>
<font color="#008000"> 'Get handle to process</font>
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0&, hInst)
<font color="#0000A0">If</font> hProcess <> 0 <font color="#0000A0">Then</font>
<font color="#008000"> 'get exit code</font>
GetExitCodeProcess hProcess, lExitCode
<font color="#0000A0">If</font> lExitCode <> 0 <font color="#0000A0">Then</font>
<font color="#008000"> 'bye-bye</font>
lRet = TerminateProcess(hProcess, lExitCode)
EndShelledProcess = lRet > 0
<font color="#0000A0">End</font> <font color="#0000A0">If</font>
<font color="#0000A0">End</font> <font color="#0000A0">If</font>
<font color="#0000A0">End</font> <font color="#0000A0">Function</font>
</FONT></td></tr></table><button onclick='document.all("9212006144126468").value=document.all("9212006144126468").value.replace(/<br \/>\s\s/g,"");document.all("9212006144126468").value=document.all("9212006144126468").value.replace(/<br \/>/g,"");window.clipboardData.setData("Text",document.all("9212006144126468").value);'>Copy to Clipboard</BUTTON><textarea style="position:absolute;visibility:hidden" name="9212006144126468" wrap="virtual">
Option Explicit
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Private Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" _
(ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" _
(ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private ShellReturnValue As Long
Private Const VBScrollFullname As String = "C:\Documents and Settings\Tom\Desktop\VBScroll.exe"
Private Sub Workbook_Open()
ShellReturnValue = Shell(VBScrollFullname)
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call EndShelledProcess
End Sub
Private Function EndShelledProcess() As Boolean
'PURPOSE: End a process started with VB's Shell Statement
'INPUT: Task ID returned by Shell
'RETURNS: True if successful, false otherwise
On Error Resume Next
Dim hInst As Long
Dim hProcess As Long
Dim lExitCode As Long
Dim lRet As Long
hInst = ShellReturnValue
If hInst = 0 Then Exit Function
'Get handle to process
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0&, hInst)
If hProcess <> 0 Then
'get exit code
GetExitCodeProcess hProcess, lExitCode
If lExitCode <> 0 Then
'bye-bye
lRet = TerminateProcess(hProcess, lExitCode)
EndShelledProcess = lRet > 0
End If
End If
End Function</textarea>
VBScrollVonPookster.zip