당신이 Excel 인스턴스를 찾기 위해 노력하고 있어요 예외는 아마도 때문에입니다 CType실패하고 던지는 InvalidCastException. 캐스트를 피하면 (처음에) 피할 수 있습니다. Dim xlObject As Object Try 'get an existing excel.application object xlObject = GetObject(, "Excel.Application") Catch ex As Exception ' Some other exception now End Try If Not xlObject Is Nothing Then ' Found something, make the cast xlApp = CType(xlObject, Application) Else ' Did not fin..