Thread: Message Box
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kstalker[_13_] Kstalker[_13_] is offline
external usenet poster
 
Posts: 1
Default Message Box


So far so good, I just have one more (probably many more) conundrum to
solve.
The code below, supplied via this site, works perfectly. But I have to
make allowance for users requesting via command button the creation of
a new book twice in one day. Conflicting file name. By default I get
the windows File already exists prompt. How can I control this so that
i can direct the navigation if 'No' is selected.

Thanks again



Sub CreateArchive()

Dim Wb As Workbook
Dim ws As Worksheet
Dim sStr As String

Application.ScreenUpdating = True

Set Wb = Workbooks("Single Sheet.xls")
Set ws = Worksheets("Master")
sStr = Format(Date, "yymmdd") & " " & "Stage Clearer"

ws.Copy

ActiveWorkbook.SaveAs "G:\" & sStr

ActiveWorkbook.Close
Application.ScreenUpdating = False

End Sub


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=384216