Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Macros Containing a File Save As & Tab Deletions

I have a macro that saves off a copy of the file, replacing the existing
saved off copy. Even though I record "yes" to replace the existing copy I am
always prompted to say/click "yes" again when the macro runs. Also, on
another macro, I delete a few tabs from the copy. I am prompted during the
recording (like "are you sure you want to delete this tab") and I still get
prompted again when the macro runs.

Is there a way to program it so the macro saves over an existing or delete
tabs without user intervention, to agree with what has already been agreed
to, while the macro is actually running?

Many thanks in advance!

Regards,
Mike
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macros Containing a File Save As & Tab Deletions

If you use something like:

Activeworkbook.save
or
thisworkbook.save

You shouldn't be prompted to overwrite the existing file.

If you're using .saveas, you can avoid the prompt:

application.displayalerts = false
activeworkbook.saveas .....
application.displayalerts = true

And the same .displayalerts will stop the prompt when you delete a sheet in
code.

Mike The Newb wrote:

I have a macro that saves off a copy of the file, replacing the existing
saved off copy. Even though I record "yes" to replace the existing copy I am
always prompted to say/click "yes" again when the macro runs. Also, on
another macro, I delete a few tabs from the copy. I am prompted during the
recording (like "are you sure you want to delete this tab") and I still get
prompted again when the macro runs.

Is there a way to program it so the macro saves over an existing or delete
tabs without user intervention, to agree with what has already been agreed
to, while the macro is actually running?

Many thanks in advance!

Regards,
Mike


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macros Containing a File Save As & Tab Deletions

Mike

Wrap the actions inside these two lines.

Application.DisplayAlerts = False

'do your code stuff

Application.DisplayAlerts = True


Gord Dibben MS Excel MVP


On Tue, 15 Aug 2006 14:01:01 -0700, Mike The Newb
wrote:

I have a macro that saves off a copy of the file, replacing the existing
saved off copy. Even though I record "yes" to replace the existing copy I am
always prompted to say/click "yes" again when the macro runs. Also, on
another macro, I delete a few tabs from the copy. I am prompted during the
recording (like "are you sure you want to delete this tab") and I still get
prompted again when the macro runs.

Is there a way to program it so the macro saves over an existing or delete
tabs without user intervention, to agree with what has already been agreed
to, while the macro is actually running?

Many thanks in advance!

Regards,
Mike


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Macros Containing a File Save As & Tab Deletions

Dave - worked great/excellent! Thank you!

"Dave Peterson" wrote:

If you use something like:

Activeworkbook.save
or
thisworkbook.save

You shouldn't be prompted to overwrite the existing file.

If you're using .saveas, you can avoid the prompt:

application.displayalerts = false
activeworkbook.saveas .....
application.displayalerts = true

And the same .displayalerts will stop the prompt when you delete a sheet in
code.

Mike The Newb wrote:

I have a macro that saves off a copy of the file, replacing the existing
saved off copy. Even though I record "yes" to replace the existing copy I am
always prompted to say/click "yes" again when the macro runs. Also, on
another macro, I delete a few tabs from the copy. I am prompted during the
recording (like "are you sure you want to delete this tab") and I still get
prompted again when the macro runs.

Is there a way to program it so the macro saves over an existing or delete
tabs without user intervention, to agree with what has already been agreed
to, while the macro is actually running?

Many thanks in advance!

Regards,
Mike


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Macros Containing a File Save As & Tab Deletions

Gord - thank you - it worked great.

"Gord Dibben" wrote:

Mike

Wrap the actions inside these two lines.

Application.DisplayAlerts = False

'do your code stuff

Application.DisplayAlerts = True


Gord Dibben MS Excel MVP


On Tue, 15 Aug 2006 14:01:01 -0700, Mike The Newb
wrote:

I have a macro that saves off a copy of the file, replacing the existing
saved off copy. Even though I record "yes" to replace the existing copy I am
always prompted to say/click "yes" again when the macro runs. Also, on
another macro, I delete a few tabs from the copy. I am prompted during the
recording (like "are you sure you want to delete this tab") and I still get
prompted again when the macro runs.

Is there a way to program it so the macro saves over an existing or delete
tabs without user intervention, to agree with what has already been agreed
to, while the macro is actually running?

Many thanks in advance!

Regards,
Mike



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
File A and File B Together BillCPA Excel Discussion (Misc queries) 1 June 6th 06 03:18 PM
Excel crashes while opening excel file imbeddied with macros ct2147 Excel Discussion (Misc queries) 0 December 30th 05 09:05 PM
Excel XP: File name in Title Bar not changed after Save As... Dominic Excel Discussion (Misc queries) 9 August 1st 05 12:58 PM
Macros and File Lost Kelli McCann Excel Discussion (Misc queries) 0 May 13th 05 12:40 AM
save excel file from a table delimited file (.txt) using macros sedamfo New Users to Excel 1 February 15th 05 04:19 AM


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