Hi, What I currently do is create a new workbook, copy the sheet 'snapshot' to the new workbook, delete 'sheet1' in the new workbook (for the asthetics), save the work book and exit. Problem is, when the code removes sheet1 it prompts to confirm, I don't want it to do this - and I can't quite figure out what you need to put it so it doesn't issue a prompt.
Private Sub CommandButton3_Click()
Dim Response As String
Dim datestring As String
Dim filename As String
Dim path As String
Set MyWorkbook = ActiveWorkbook
Set MySheet = ActiveWorkbook.Worksheets("Patient Delay"
Dim SnapshotSheet As Object
Set SnapshotSheet = CreateObject("Excel.Sheet"
datestring = (Trim(Str(Day(Now())) + "-" + Str(Month(Now())) + "-" + Str(Year(Now()))))
path = "C:\"
filename = path + "Snapshot " + datestring + ".xls"
Response = MsgBox(filename)
MyWorkbook.Sheets("Snapshot".Select
MyWorkbook.Sheets("Snapshot".Copy After:=SnapshotSheet.Worksheets("Sheet1"
SnapshotSheet.Sheets("Sheet1".Select
ActiveWindow.SelectedSheets.Delete
SnapshotSheet.SaveAs (filename)
MyWorkbook.Sheets("Patient Delay".Activate
End Sub
Thats the code - Any help appericated guys
Private Sub CommandButton3_Click()
Dim Response As String
Dim datestring As String
Dim filename As String
Dim path As String
Set MyWorkbook = ActiveWorkbook
Set MySheet = ActiveWorkbook.Worksheets("Patient Delay"
Dim SnapshotSheet As Object
Set SnapshotSheet = CreateObject("Excel.Sheet"
datestring = (Trim(Str(Day(Now())) + "-" + Str(Month(Now())) + "-" + Str(Year(Now()))))
path = "C:\"
filename = path + "Snapshot " + datestring + ".xls"
Response = MsgBox(filename)
MyWorkbook.Sheets("Snapshot".Select
MyWorkbook.Sheets("Snapshot".Copy After:=SnapshotSheet.Worksheets("Sheet1"
SnapshotSheet.Sheets("Sheet1".Select
ActiveWindow.SelectedSheets.Delete
SnapshotSheet.SaveAs (filename)
MyWorkbook.Sheets("Patient Delay".Activate
End Sub
Thats the code - Any help appericated guys