'Make a temporary GE .kml file
File_xkm = FreeFile
Open mydirectory + "C_wiz GE temp.kml" For Output As File_xkm
Close #File_xkm
'Get the GE executable name
GE_exe = Space$(1024)
rc& = FindExecutable(mydirectory + "C_wiz GE temp.kml", "", GE_exe)
'Delete the temporary .kml file
Kill mydirectory + "C_wiz GE temp.kml"
'For all possible chars in GE executable name, starting at end...
For i% = 1024 To 1 Step -1
'Quit loop if non-terminator and non-blank char found
If Mid$(GE_exe, i%, 1) <> Chr$(0) And Mid$(GE_exe, i%, 1) <> " " Then Exit For
Next
'Trim GE executable name
GE_exe = Left$(GE_exe, i%)
'For all chars in GE executable name...
For i% = 1 To Len(GE_exe)
'Replace any terminator chars with blank chars (see Microsoft KB article
'KB140724)
If Mid$(GE_exe, i%, 1) = Chr$(0) Then Mid$(GE_exe, i%, 1) = " "
Next
'If GE executable name found...
If GE_exe <> "" Then
'If GE executable not found...
If Dir(GE_exe) = "" Then
'Flush GE executable name
GE_exe = ""
End If
End If