sbubendorf
09-28-2005, 02:09 PM
Sub DeleteActiveWS()
'Every macro should have this of course...
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
'Every macro should have this of course...
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Can someone help me to modify the code above to unprotect the active workbook (no password) prior to deleting the active sheet? The code, as posted, "chokes" on protected workbooks, but will work fine if I manually turn off the workbook protection.
Note: code above was found at the following address:
http://www.mvps.org/dmcritchie/excel/sheets.htm
THANK YOU VERY MUCH FOR ANY HELP THAT CAN BE PROVIDED !!!
(Excel 2003, Windows XP Pro)
(Using the code above as an add-in.)
(Absolute Beginner @ Excel Macros.)
'Every macro should have this of course...
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
'Every macro should have this of course...
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Can someone help me to modify the code above to unprotect the active workbook (no password) prior to deleting the active sheet? The code, as posted, "chokes" on protected workbooks, but will work fine if I manually turn off the workbook protection.
Note: code above was found at the following address:
http://www.mvps.org/dmcritchie/excel/sheets.htm
THANK YOU VERY MUCH FOR ANY HELP THAT CAN BE PROVIDED !!!
(Excel 2003, Windows XP Pro)
(Using the code above as an add-in.)
(Absolute Beginner @ Excel Macros.)