Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time error '1004'
If the cells are already merged and formatted, you can simply delete the
offending line(s) [there may be more to encounter later]. Or you can put On Error Resume Next in front of all of the formatting code and then put On Error Goto 0 after it is all done. Only problem with that is that if another, more consequential error takes place in there, then you won't know about it. "gwinder" wrote: Thanks. OK...the offending line in my code is: ma.MergeCells = False My code is to allow the text to wrap in merged cells Gary "JLatham" wrote: The fact that it is a Run-Time error and the rest of the message leads me to think that there is some code attached to that worksheet or elsewhere that is trying to put text into the cells. The code probably also tries to set the text wrap properties. The cell is locked, so when you protect the sheet, the code is unable to modify the content/format of the cell(s). Next time it comes up, or you force the error, there should be 2 buttons on the error message dialog: [End] [Debug]. Try hitting debug and see where you are - the offending line in the VBA code will be highlighted. Now, what you do after that, is entirely dependent on what you're trying to do in general. "gwinder" wrote: When I protect a sheet I get the following message when trying to enter text into a cell: Unable to set the MergeCells property of the Range Class I do have code that that allows automatic wrap of text in merged cells. Is there something I need to modify in the code? Thanks Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Time Error 1004: Application or Object Defined Error | Excel Programming | |||
Run Time 1004 Error: Application or Object Difine Error | Excel Programming | |||
Run-time error 1004 - General ODBC Error | Excel Programming | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming |