Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Everytime i close an excel file, it creates a new backup file | Excel Discussion (Misc queries) | |||
Close Second Version of Excel file | Excel Discussion (Misc queries) | |||
Close a File and Excel ?? | Excel Programming | |||
File close excel does not ask me to save changes | Excel Discussion (Misc queries) | |||
How to Close the entire Excel File | Excel Programming |