Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
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)

Reply With Quote
  #3 (permalink)  
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

Reply With Quote
  #4 (permalink)  
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


Reply With Quote
  #5 (permalink)  
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:59 PM.


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