Try something like this ....??
Private Declare Function GetWindowsDirectoryA Lib "KERNEL32" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
'This function returns the length, in characters,
'of the string copied to the buffer, excluding the terminating null character.
'· lpBuffer
'Points to the buffer to receive the null-terminated string containing the path.
'This path does not end with a backslash unless the Windows directory is the root directory. For example, if the Windows directory is named WINDOWS on drive C, the path of the Windows directory retrieved by this function is C:\WINDOWS. If Windows was installed in the root directory of drive C, the path retrieved is C:\.
'· nSize
'Specifies the maximum size, in characters, of the buffer specified by the lpBuffer
'parameter.
Private Function GetWindowsDirectory() As String
Dim sWinDir As String
Dim i As Integer
i = GetWindowsDirectoryA("", 0)
sWinDir = Space(i)
GetWindowsDirectoryA sWinDir, i
GetWindowsDirectory = AddBackslash(Left$(sWinDir, i - 1))
End Function
Private Function AddBackslash(sWinDir As String) As String
If Len(sWinDir) > 0 Then
If Right$(sWinDir, 1) <> "\" Then
AddBackslash = sWinDir + "\"
Else
AddBackslash = sWinDir
End If
Else
AddBackslash = "\"
End If
End Function
Sub Lauch_Calc_()
Dim FilePath As String
Dim Run
FilePath = GetWindowsDirectory & "Calc.exe"
Run = Shell(FilePath, vbMaximizedFocus)
End Sub
Ivan