Are you sure that you got the error message number right? The value you
provide causes an overflow on a Long data type, and system error messages
are always Long data types.
You can normally retrieve the exact error text associated with a system
error number using the GetSystemErrorMessageText function described on
http://www.cpearson.com/excel/FormatMessage.htm
This procedure, however, requires a Long data type for the error number, and
your error number is not a Long.
All that said, it sounds to me like you have the structure of the workbook
protected. Go to the Tools menu, choose Protection, and select UnProtect
Workbook. Supply the appropriate password if prompted.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)
"MSweetG222" wrote in message
...
I received a -21474147848 error code (descr: method of 'Delete' of object
'_Worksheet' failed) when deleting a worksheet (using vba). The vba code
is
held in a .xla file. This error issue was only occurring when I used a
particular workbook. I have no issues performing the same actions in a
different .xls workbook.
I don't know if I solved the issue or just delayed it, but this is what I
did...
I modified the .xla code to 1. set the workbook calculation status to
Manual, 2. performed the delete worksheet code and then 3. returned the
workbook calcuation to Automatic.
Comments?
Thx
MSweetG222