View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Fredrik Wahlgren Fredrik Wahlgren is offline
external usenet poster
 
Posts: 339
Default Error 1004 Method 'Add'of Object Sheets failed


"ExcelMonkey" wrote in message
...
I have a an macro that always works. It an addin which
creates an summary sheet in the active workbook. I just
ran it on a file and recieved this message:

Error 1004 Method 'Add'of Object Sheets failed

the line of code it is failing on is this:

.Worksheets.Add(After:=.Worksheets
(.Worksheets.Count)).Name = AuditShtName

Why would this be failing? Could this be a workbook
protection issue? When I go to Tools\Protection\ is does
not give the unprotect option.

THanks


Maybe the code tries to add a worksheet with a name that already exists.

/Fredrik