Run-time error '1004': Method 'Worksheets' of object '_Global' failed
I get this error when running the following code:
Sub NewSheet()
'
''
''''''''
' Create/rename new sheet.
''''''''
''
'
Dim NWS As Worksheet
Set NWS = Sheets.Add(After:=Worksheets(Worksheets.Count))
NWS.Name = "WAWA " & Format(Date, "mm-dd-yyyy")
End Sub
I just want to add a sheet at the end of the workbook. This code used to work just fine with Windows XP and Office 2007. We recently updated to Windows 7 and Office 2010 and now the code breaks at the Set NWS line. Am I missing a reference somewhere? Thanks for any suggestions!
Bookmarks