Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If displayalerts is true, then you should get a warning/prompt if you want
to overwrite the file. -- Regards, Tom Ogilvy Mark Worthington wrote in message om... Can anyone please advise me about the correct operation of SaveCopyAs. I am using it as follows: MsgBox Application.DisplayAlerts MsgBox ActiveWorkbook.Path & "\_new\" & ActiveWorkbook.Name ActiveWorkbook.SaveCopyAs ActiveWorkbook.Path & "\_new\" & ActiveWorkbook.Name So DisplayAlerts is True, yet I get no warning when the SaveCopyAs overwrites the existing (pre-saved) file. Is this by design, or am I missing something here. Coding in a FileExists check is no problem, but I would have thought that ANY save operation would give an overwrite warning by default. Regards, Mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I misread your post (saw SaveAs, rather than SaveCopyAs) - SaveCopyAs
does not give a warning, so you will need to check it yourself. Since it is designed to be used to create a backup, I assume the philosophy is that the default behavior would be that there is a previous backup that should be overwritten. -- Regards, Tom Ogilvy Tom Ogilvy wrote in message ... If displayalerts is true, then you should get a warning/prompt if you want to overwrite the file. -- Regards, Tom Ogilvy Mark Worthington wrote in message om... Can anyone please advise me about the correct operation of SaveCopyAs. I am using it as follows: MsgBox Application.DisplayAlerts MsgBox ActiveWorkbook.Path & "\_new\" & ActiveWorkbook.Name ActiveWorkbook.SaveCopyAs ActiveWorkbook.Path & "\_new\" & ActiveWorkbook.Name So DisplayAlerts is True, yet I get no warning when the SaveCopyAs overwrites the existing (pre-saved) file. Is this by design, or am I missing something here. Coding in a FileExists check is no problem, but I would have thought that ANY save operation would give an overwrite warning by default. Regards, Mark |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
Yes, I guessed the same. Actually, I thought of the designers saying "what would be a really dumb thing to do, such that its behaviour will be the opposite to its siblings (Save & SaveAs)" ...! Oh well, one gets used to unusual Excel characteristics. It is also strange that this is not really documented (unlike ActiveWorkbook.CreateBackup) and I couldn't even find this out in such a tome as JW's Excel 2002 Power Programming with VBA. It seems such a useful method, too ….. Bob, Yes, the directory has to be present, as I found out! Regards, and thanks for your help, Mark *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Savecopyas without password | Excel Discussion (Misc queries) | |||
SaveCopyAs with a twist | Excel Discussion (Misc queries) | |||
SaveCopyAs macro | Excel Programming | |||
SaveCopyAs - Userform disappears | Excel Programming |