Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Locked Property Error


Hey guys,

In one of my macros, I am trying to unlock a given cell by saying
Cells(row number, column letter).Locked = False. I have used it before
and it worked, but for some reason, I keep getting an error which
states:

Run-time error '1004':

Unable to set the Locked property of the Range class


The sheets are unprotected so that shouldn't be an issue. Does anyone
know how to fix this? Thanks in advance and please let me know if you
need more information.


--
Raman325
------------------------------------------------------------------------
Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748
View this thread: http://www.excelforum.com/showthread...hreadid=470601

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Locked Property Error

Is the cell/range merged?

This worked ok when I merged A1:B1
Cells(1, 1).MergeArea.Locked = False

Maybe the rownumber and/or columnletter weren't correct?




Raman325 wrote:

Hey guys,

In one of my macros, I am trying to unlock a given cell by saying
Cells(row number, column letter).Locked = False. I have used it before
and it worked, but for some reason, I keep getting an error which
states:

Run-time error '1004':

Unable to set the Locked property of the Range class


The sheets are unprotected so that shouldn't be an issue. Does anyone
know how to fix this? Thanks in advance and please let me know if you
need more information.

--
Raman325
------------------------------------------------------------------------
Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748
View this thread: http://www.excelforum.com/showthread...hreadid=470601


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Locked Property Error


Thank you for the response. I checked the reference t omake sure it wa
correct and it was fine. It is part of a merged cell, however. If I us
the MergedArea reference like you have used, will it work on cells tha
haven't been merged as well

--
Raman32
-----------------------------------------------------------------------
Raman325's Profile: http://www.excelforum.com/member.php...fo&userid=2474
View this thread: http://www.excelforum.com/showthread.php?threadid=47060

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Locked Property Error

What happened when you tried it?

(It worked ok for me.)

Sometimes, it's just quicker to try it out.

Raman325 wrote:

Thank you for the response. I checked the reference t omake sure it was
correct and it was fine. It is part of a merged cell, however. If I use
the MergedArea reference like you have used, will it work on cells that
haven't been merged as well?

--
Raman325
------------------------------------------------------------------------
Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748
View this thread: http://www.excelforum.com/showthread...hreadid=470601


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Locked Property Error

Yes it will, but how easy would it have been to test it?

--
Regards,
Tom Ogilvy


"Raman325" wrote in
message ...

Thank you for the response. I checked the reference t omake sure it was
correct and it was fine. It is part of a merged cell, however. If I use
the MergedArea reference like you have used, will it work on cells that
haven't been merged as well?


--
Raman325
------------------------------------------------------------------------
Raman325's Profile:

http://www.excelforum.com/member.php...o&userid=24748
View this thread: http://www.excelforum.com/showthread...hreadid=470601





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Locked Property Error


Sorry about that, unfortunately, I did not have access to the macro when
I had sent you that response. Thanks again for your help.


--
Raman325
------------------------------------------------------------------------
Raman325's Profile: http://www.excelforum.com/member.php...o&userid=24748
View this thread: http://www.excelforum.com/showthread...hreadid=470601

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
Locked Property off, but cannot select cell Steve Excel Discussion (Misc queries) 3 June 19th 14 04:29 PM
Runtime Error 380 – Could not set the list property. Invalid property value BernzG[_16_] Excel Programming 2 August 21st 05 10:10 PM
Runtime error 380: Could not set the List property. invalid property value of listbox jasgrand Excel Programming 0 October 6th 04 09:28 PM
Unable to set the Locked property of the range class Stuart[_5_] Excel Programming 5 June 25th 04 03:32 PM
Userform and controls locked property D.S.[_3_] Excel Programming 3 November 28th 03 03:00 PM


All times are GMT +1. The time now is 12:04 PM.

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

About Us

"It's about Microsoft Excel"