Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,365
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Time Error 1004: Application or Object Defined Error BEEJAY Excel Programming 4 October 18th 06 04:19 PM
Run Time 1004 Error: Application or Object Difine Error BEEJAY Excel Programming 0 October 17th 06 10:45 PM
Run-time error 1004 - General ODBC Error Linda Excel Programming 0 July 5th 06 04:32 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM


All times are GMT +1. The time now is 09:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"