I used this to detect a default browser and launch it, so this can be modified to launch Excel:<br>
<br>
These two statements are module level declares:<br>
Dim m_sPath As String<br>
Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long<br>
<br>
In the click event, or whatever your kick off event is:<br>
Private Sub cmdExplore_Click()<br>
<br>
Dim lRetVal As Long<br>
Dim sBrowserExec As String<br>
Dim sFileName As String<br>
Dim sFilePart As String<br>
<br>
On Error GoTo cmdExplore_Click_Error<br>
'fill the string with spaces<br>
sBrowserExec = Space(255)<br>
'fill the string with the path and filename <br>
'of the file you want to open<br>
sFileName = m_sPath & m_sIndex<br>
'find the default web browser or in your case<br>
'the version of Excel on the user's system<br>
lRetVal = FindExecutable(sFileName, sFilePart, sBrowserExec)<br>
'remove the null off of the return value<br>
sBrowserExec = sRemoveNull(sBrowserExec)<br>
'launch excel<br>
Shell sBrowserExec & " " & m_sPath & m_sIndex, vbNormalFocus<br>
Exit Sub<br>
<br>
cmdExplore_Click_Error:<br>
MsgBox Err.Description, vbOKOnly<br>
Resume Next<br>
End Sub<br>
<br>
Private Function sRemoveNull(sString As String) As String<br>
<br>
On Error GoTo sRemoveNull_Error<br>
sRemoveNull = Left$(sString, InStr(sString, Chr(0)) - 1)<br>
Exit Function<br>
<br>
sRemoveNull_Error:<br>
sRemoveNull = sString<br>
End Function<br>
<br>
Hope this helps!<br>
<br>
kleo<br>
<br>
kleo9@hotmail.com