G
Guest
I have a spreadsheet that when opened for the first time opens to a sheet
named start and all other sheets are hidden. You click on a button that says
start and it runs this script:
Private Sub cmdactivation_Click()
'1)unhide sheets, 2)create datasheet, 3)delete sheet3, delete sheet2, select
sheet1, 4)rename, save & close 5)delete start sheet
Sheets("CONTROL PANEL").Visible = True
Workbooks.Add
ActiveWorkbook.SaveAs FileName:= _
"C:\windows\datasheet2006.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "datasheet"
ActiveWorkbook.Save
ActiveWindow.Close
Sheets("START").Select
On Error Resume Next
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
End Sub
If the datasheet2006.xls it creates already exists I get an error saying it
already exists do I want to replace it. Is there a way to stop the windows
error message from coming up and just replace it by default?
Thanks,
Phil
named start and all other sheets are hidden. You click on a button that says
start and it runs this script:
Private Sub cmdactivation_Click()
'1)unhide sheets, 2)create datasheet, 3)delete sheet3, delete sheet2, select
sheet1, 4)rename, save & close 5)delete start sheet
Sheets("CONTROL PANEL").Visible = True
Workbooks.Add
ActiveWorkbook.SaveAs FileName:= _
"C:\windows\datasheet2006.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "datasheet"
ActiveWorkbook.Save
ActiveWindow.Close
Sheets("START").Select
On Error Resume Next
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
End Sub
If the datasheet2006.xls it creates already exists I get an error saying it
already exists do I want to replace it. Is there a way to stop the windows
error message from coming up and just replace it by default?
Thanks,
Phil