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


Thanks for that. As predicted I have hit another wall

I am trying to run another sub dependent on Yes/No, but regardless o
selection it runs.

How can I prevent this?


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


If file_exist("G:\") Then
MsgBox "This file already Exists. Do you want to overwrite it?"
vbYesNo
If vbYes Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "G:\\" & sStr
ActiveWorkbook.Close

COMPILE_DATA.COPYUSEDRANG

Application.DisplayAlerts = True
End If

Else

ActiveWorkbook.SaveAs "G:\ & sStr
Worksheets("navigation").Select
End If

Application.ScreenUpdating = False

End Sub

Thanks agai

--
Kstalke
-----------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...fo&userid=2469
View this thread: http://www.excelforum.com/showthread.php?threadid=38421