VB Automation with Excel does not close Excel instance 
Author Message
 VB Automation with Excel does not close Excel instance

I have a VB6 app that opens Excel and then sets the active sell to A1.  Then
it does a Cells.find.  The problem is that if I do a Cells.Find I can't seem
to close Excel, even after doing a quit and de-referencing all the objects.
The Excel instance goes away just fine without the code that does the
Cells.Find.  When I look at the Locals windows, all objects are set to
nothing.Has anyone else seen this?  Thanks.




Sun, 10 Aug 2003 08:43:06 GMT  
 VB Automation with Excel does not close Excel instance
Darrin,

This is a bit of a guess, but I remember there being a glitch with the
Application.Quit method.

I think the solution was to immediately follow the Application.Quit with an
End statement on the next line of code.  For example:

Sub Junk1()

'''code stuff here...

'''Quit the application.
   Application.Quit
   End

End Sub

Give this a try.

Troy


Quote:
> I have a VB6 app that opens Excel and then sets the active sell to A1.
Then
> it does a Cells.find.  The problem is that if I do a Cells.Find I can't
seem
> to close Excel, even after doing a quit and de-referencing all the
objects.
> The Excel instance goes away just fine without the code that does the
> Cells.Find.  When I look at the Locals windows, all objects are set to
> nothing.Has anyone else seen this?  Thanks.





Mon, 11 Aug 2003 09:39:25 GMT  
 VB Automation with Excel does not close Excel instance
Hi Darrin,

You have to preface the Cells.Find with the appropriate object so it is
fully-qualified.  Maybe something like
xlApp.Workbooks(1).Worksheets(1).Cells.Find would work.  If that doesn't
help, or if you're already doing that, post the relevant code, including
your Automation declarations, instantiation and setup code, the Cells.Find
code, and your references "cleanup" code.

Regards,
Jake Marx


Quote:
> I have a VB6 app that opens Excel and then sets the active sell to A1.
Then
> it does a Cells.find.  The problem is that if I do a Cells.Find I can't
seem
> to close Excel, even after doing a quit and de-referencing all the
objects.
> The Excel instance goes away just fine without the code that does the
> Cells.Find.  When I look at the Locals windows, all objects are set to
> nothing.Has anyone else seen this?  Thanks.





Mon, 11 Aug 2003 13:22:50 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Excel Automation - Problem closing instance of Excel from with Access2000

2. Access/Excel Automation - Excel Not Closing

3. Access/Excel Automation - Excel Not Closing

4. Hidden instance of Excel running even after closing it explicitly from VB

5. closing an instance of Excel from VB Application

6. Close an Excel instance from VB

7. Closing an Instance of Excel from VB Application

8. Excel Automation with multiple instances of Excel running

9. Closing Excel with VB automation

10. Instance of Excel still running after Excel object closed


 
Powered by phpBB® Forum Software © phpBB Group