Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Have Excel file close itself

dim wb as workbook
set wb = workbooks("YourWorkbookName")
wb.close

or just flat out:
application.quit

Cheers,
Jason Lepack

XP wrote:
I am using Office 2003 on Windows XP.

I have VBA code that:

1. Checks to see if a folder exists
2. If it doesn't, the program creates it
3. If it does exist, the program deletes all files in it
4. It then copies an MDB file from a network location into the folder
5. It then opens MS-Access and loads the file

This all runs fine, but I need the MS-Excel file to close itself when all of
this is done. The problem is, once step 5 completes, focus is lost and the
Excel file doesn't close...

I would really prefer the solution to reside in the Excel file. Does anyone
have a code solution for this or some other work arounds/ideas?

Thanks.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Everytime i close an excel file, it creates a new backup file p Excel Discussion (Misc queries) 3 November 22nd 07 08:13 AM
Close Second Version of Excel file Sparkybird Excel Discussion (Misc queries) 1 July 24th 06 10:54 PM
Close a File and Excel ?? rvillanueva[_5_] Excel Programming 6 May 1st 06 05:42 AM
File close excel does not ask me to save changes Cathy Humphreys Excel Discussion (Misc queries) 2 June 13th 05 08:48 PM
How to Close the entire Excel File Duraiswamy Lingappan Excel Programming 1 July 16th 04 11:12 AM


All times are GMT +1. The time now is 04:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"