View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nitin[_3_] Nitin[_3_] is offline
external usenet poster
 
Posts: 2
Default Closing Excel From VB

Hi guys
I am having problem in closing the excel application from my COM Component
I have following code in one of my COM method and when the method finishes, I still see Excel application running in task ba

can anyone help me? please can you tell me what i am doing wrong? Thanks in advanc

Dim appXl As Excel.Applicatio
Dim oWorkBook As Excel.Workboo
Dim qTable As Excel.QueryTabl

Set appXl = CreateObject("Excel.Application"
appXl.Workbooks.Open "someifle.xls

'' import the text fil
Set qTable = appXl.ActiveSheet.QueryTables.Add(Connection:=
"TEXT;" & strCSVFileName, Destination:=Range("A1")

For Each oWorkBook In appXl.Workbook
oWorkBook.Close SaveChanges:=Tru
oWorkBook.Application.Qui
Nex

Set qTable = Nothin
appXl.Qui
Set oWorkBook = Nothin
Set appXl = Nothing