Re: How to kill Excel Instance

From: Tom Ogilvy (twogilvy_at_msn.com)
Date: 09/15/04


Date: Wed, 15 Sep 2004 13:52:27 -0400

I answered the question. Your answer represents you don't understand the
significance of the using the new keyword.

I also highlighted areas that could be causing your problem and suggested
how to fix it. Since you obviously have made no attempt to test the
suggestions, there is little else that can be said.

-- 
Regards,
Tom Ogilvy
"JRudy" <rsusanto@skdautomotive.com> wrote in message
news:OEH7Oi0mEHA.3844@TK2MSFTNGP10.phx.gbl...
> Tom,
>
> thx for your feedback
> but I did it from MS ACCESS
> that's why I need to make new instance.
> Whenever I set nothing and quit the excel, I still see the instance at the
> task manager.
> Any idea how can I work it out ?
>
>
> "Tom Ogilvy" <twogilvy@msn.com> wrote in message
> news:%238EvluymEHA.2616@tk2msftngp13.phx.gbl...
> > since you do
> > Dim oExcel As New Excel.Application
> >
> > the first time you refer to oExcel, a new instance will be created.  You
> > don't need CreateObject
> >
> > I would release the variables like this.  (and add references to
> > ActiveWorkbook
> >
> >
> >     Call Locate_file
> >     o***.Activate
> >     oExcel.Visible = True
> >     o***.Copy
> >     set o*** = nothing
> >     oInvbook.Close
> >     set oInvbook = nothing
> >
> >     oExcel.ActiveWorkbook.SaveAs Filename:=vPath & " vfname" & ".xls"
> >     oExcel.ActiveWorkbook.Close
> >     oExcel.Quit
> >     Set oExcel = Nothing
> >
> >
> > END SUB
> >
> > -- 
> > Regards,
> > Tom Ogilvy
> >
> >
> > "JRudy" <rsusanto@skdautomotive.com> wrote in message
> > news:er2f4aymEHA.3868@TK2MSFTNGP11.phx.gbl...
> >> Hi,
> >>
> >> I have code here to kill Excel Instance, but the process won't ended.
Any
> >> sugestion for it ?
> >>
> >> btw,I ran my code in MS ACCESS
> >>
> >> SUB TEST
> >>    Dim oExcel As New Excel.Application
> >>     Dim oInvbook As Excel.Workbook
> >>     Dim o*** As Excel.Work***
> >>
> >>
> >>     Set oExcel = CreateObject("excel.application")
> >>     Set oInvbook =
> > oExcel.Workbooks.Open("\\cd020\db\productionsummary.xls",
> >> , , , , , , , , True)
> >>     Set o*** =
> >> oExcel.Workbooks("productionsummary.xls").Sheets("shift_sum2x")
> >>
> >>     Call Locate_file
> >>     o***.Activate
> >>     oExcel.Visible = True
> >>     o***.Copy
> >>     oInvbook.Close
> >>
> >>     ActiveWorkbook.SaveAs Filename:=vPath & " vfname" & ".xls"
> >>     ActiveWorkbook.Close
> >>     oExcel.Quit
> >>     Set oExcel = Nothing
> >>     set oInvbook = nothing
> >>     set o*** = nothing
> >> END SUB
> >>
> >>
> >
> >
>
>