View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Error 1004 Method 'Add'of Object Sheets failed

Activeworkbook.Readonly will tell you the first, but that doesn't stop you
adding sheets, just saving it.

You get the goodies don't you :-)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ExcelMonkey" wrote in message
...
No Bob it has a name - "Audit Results". This is odd as
this work on all other files. And there is not a sheet in
the file called "Audit Result".

If this workbook were protected or Read only - how would I
know?


-----Original Message-----
What is in AuditShtName? Sure it is not empty or a

duplicate name?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ExcelMonkey" wrote

in message
...
Please also note that I can Insert Worksheets

manually. I
don't get it???


-----Original 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
.



.