Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do you replace an existing file, saying "yes" in a macro?

Ok, I have a macro set up that creates an excel file using
different criteria. I have it create 5 "alternatives"
that each is a different file. After 5, you are not
allowed to create any more. If you try to create another
one, a message box pops up saying, do you want to replace
the existing file? The file already exists, and if you
say "no", or hit "cancel", my macro bombs out because of
the saveas property. Here is an example of my code:

ActiveWorkbook.SaveAs ("C:\" & pname & "-" & tod_month
& "_" & tod_day & "_" & tod_year & "_" & Alt_Name)

ActiveWorkbook.Close

It always bombs out at the SaveAS line. Any help would be
greatly appreciated. Email me if you have a solution.
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
"Find" a wildcard as a place marker and "replace" with original va Eric Excel Discussion (Misc queries) 1 January 27th 09 06:00 PM
Insert "Proper Function" into existing macro jackel[_14_] Excel Worksheet Functions 10 March 10th 08 04:00 PM
Macro to Replace/Delete Text Using "Watchword" List? PBJ Excel Discussion (Misc queries) 10 June 29th 07 09:50 PM
Replace dialog should put focus on "Find What" not "Replace With" Michael Williams Excel Discussion (Misc queries) 0 May 24th 06 12:45 PM
"Go ahead and replace file" command? Ed[_9_] Excel Programming 2 October 7th 03 04:14 PM


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