| Set WSH = CreateObject("WScript.Shell")
strReg = WSH.RegRead("HKCR\Excel.Application\CLSID\")
strReg = WSH.RegRead("HKCR\CLSID\" & strReg & "\LocalServer\")
strReg = Replace( strReg, "/automation", "", 1, -1, 1 )
strReg = Trim( strReg )
strReg = """" & strReg & """" & " " & """" & TargetExcel & """"
Call WSH.Run(strReg)
Set WSH = Nothing
| |