Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 20th, 2005, 03:48 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel does not quit

Hi,

I have a problem when I automate Excel from Access
I have tried early and late bindning.
Everything goes fine but Excel remains in Windows Task Manager

My code is here

Sub OpenExcel()
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
' Show Excel Open file dialog
xlApp.Application.Dialogs(1).Show "C:\"
' Some code to process here
xlApp.Quit
Set xlApp = Nothing

End Sub


Any succestions?

-vemaju

__________________
-vemaju
 
Old February 22nd, 2005, 04:04 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You are probably doing Set xlApp=Nothing too quickly because xlApp.Quit is a slower command to execute. This command "xlApp.Quit" needs some time the process is in the background and the parent object (xlapp) is is set to Nothing

Try using DoEvents before doing Set xlApp=Nothing

Regards
Amjad Mahmood (email: amjad.s.mahmood@gsk.com)

 
Old February 22nd, 2005, 04:22 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

It does not work, because I have closed xlApp (Excel)

-vemaju

 
Old February 22nd, 2005, 05:44 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

You can Try a dummy message box, which will have user to click OK, before doing Set xlApp=Nothing


 
Old February 22nd, 2005, 06:40 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

This does not work. Excel stays anyway in Task Manager

-vemaju





Similar Threads
Thread Thread Starter Forum Replies Last Post
Form quit and Access debor19071 Access VBA 1 March 3rd, 2008 09:51 AM
Auto run quit not cleat anukagni Access 4 June 22nd, 2007 01:32 AM
Excel does not quit vemaju Access VBA 0 February 23rd, 2005 02:26 PM
Word VBA "Before Appliction.quit Holger Hamburger Excel VBA 1 July 8th, 2004 06:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.