Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default closing file

Hello,

I have a module that sorts data for me. part of the code opens a source file
then saves it to another directory with todays date and adds a number to it
it there is another file with that same name.
my question is how can i close the save as file,

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default closing file

hi
the saved file should be the active file so add a line of code to the macro.
ActiveWorkbook.Close

this assumes no changes were made to the saved file. if changes were made,
then it needs to be saved again.
ActiveWorkbook.Close True

regards
FSt1

regards
FSt1

"Novice Lee" wrote:

Hello,

I have a module that sorts data for me. part of the code opens a source file
then saves it to another directory with todays date and adds a number to it
it there is another file with that same name.
my question is how can i close the save as file,

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default closing file

Thanks that was it

"FSt1" wrote:

hi
the saved file should be the active file so add a line of code to the macro.
ActiveWorkbook.Close

this assumes no changes were made to the saved file. if changes were made,
then it needs to be saved again.
ActiveWorkbook.Close True

regards
FSt1

regards
FSt1

"Novice Lee" wrote:

Hello,

I have a module that sorts data for me. part of the code opens a source file
then saves it to another directory with todays date and adds a number to it
it there is another file with that same name.
my question is how can i close the save as file,

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default closing file

ActiveWorkbook.Close



"Novice Lee" wrote in message
...
Hello,

I have a module that sorts data for me. part of the code opens a source
file
then saves it to another directory with todays date and adds a number to
it
it there is another file with that same name.
my question is how can i close the save as file,

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
How to skip the save file notoification on file closing? Dan Excel Worksheet Functions 1 August 19th 07 02:26 PM
Closing a file Gert-Jan[_2_] Excel Programming 4 June 5th 07 06:45 PM
Open external data (varying file names) and closing file once data is retrieved Corrie Excel Programming 2 December 31st 06 09:56 PM
VBA Closing File John Viall[_2_] Excel Programming 3 April 7th 05 03:49 PM
VBA closing one file colic Excel Programming 2 September 25th 03 05:16 PM


All times are GMT +1. The time now is 06:12 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"