Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lou Lou is offline
external usenet poster
 
Posts: 5
Default Close Workbook from Macro

I have workbook A.xls in which I run a macro that will
import a text file (B.txt) and save it as B.xls.

Can I incorporate a statement in my macro in A.xls that
will close A.xls at the end?

TIA.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Close Workbook from Macro

If you want to save before close
Thisworkbook.Close Tru

if you want the workbook close without save
Thisworkbook.Close Fals

Regards

http://www.vonixx.co


----- Lou wrote: ----

I have workbook A.xls in which I run a macro that will
import a text file (B.txt) and save it as B.xls

Can I incorporate a statement in my macro in A.xls that
will close A.xls at the end

TIA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Close Workbook from Macro

Lou

Just include this as your last line of code


Workbooks(ThisWorkbook.Name).Close SaveChanges:=Fals

--
Message posted from http://www.ExcelForum.com

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
Macro to Close a specific workbook. Dmad11 Excel Discussion (Misc queries) 1 July 7th 09 09:28 PM
Macro to close workbook with prompt JMac[_2_] Excel Worksheet Functions 1 January 31st 08 05:29 PM
Macro to close workbook and re-open new copy Dave Lagergren Excel Discussion (Misc queries) 2 February 28th 07 10:11 PM
run macro on workbook close Nigel Excel Discussion (Misc queries) 3 November 29th 05 08:48 PM
Close current Workbook after calling macro in other Des Janke Excel Programming 4 August 7th 03 07:33 AM


All times are GMT +1. The time now is 08:07 AM.

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"