×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Closing Excel from Access VBA Module

Closing Excel from Access VBA Module

Closing Excel from Access VBA Module

(OP)
Hello everyone...

I am having a problem closeing an instance of Excel from within an Access VBA module.  The window disappears, but the Excel process does not.  Could someone tell me the correct way to do this?

RE: Closing Excel from Access VBA Module

It would be helpful if you post the code that is not working when you ask a question.
Are you Executing the Application.Quit method of the excel oobject? If so are you also using Set ExcelObject = Nothing ? A com object is not removed from memory until its refrence count = 0. Until you set the variable to Nothing your refrence to the object is not released.

Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?  
For innovative, low cost solutions check out my website.
www.plccontroltechnologies.com

RE: Closing Excel from Access VBA Module

(OP)
The code I am using is as follows:

Dim myApp as Excel.Application
set myApp = new Excel.Application
myApp.Visible=True //so I can see it close
  ...code to read in some data
  
  Then, I have tried the following, none of which work to remove the Excel process from memory...

1.  myApp.quit (or close)
2.  myApp.Application.quit
3.  myApp.Workbooks.close

Then...

set myApp = Nothing

This successfully closes the window, however, the 'Excel' process remains in memory and causes Access to hang.  Thank you for your reply, this problem is really bugging me.

RE: Closing Excel from Access VBA Module

I never had this problem until I had to add a WorkSheet.Activate command.  Now I have the same problem, and the only way I can make it work is to remove the .Activate (but then other things don't work).  I did try WorkSheet.Select rather than WorkSheet.Activate, but with the same result.  I hope someone out there can help us out.  Good luck. -- Ham Rutledge

RE: Closing Excel from Access VBA Module

I am having the same issue with the same code. I am interested to see if there is anything suggested from the forum. I have not experienced Access hanging on any of the code or processes, but the instance of Excel in the background will cause resource problems on my user's PCs once I roll out my program.


Bryan Meek
bmeek@pacbell.net
http://www.handtech.com/meekent
A "Solution Provider" in your corner gives you the personal attention you need to find the right technology solutions for your business.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close