Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default "Unable to set the ..." in Excel 97

Howdy
I'm having some problems with my file created in xl2002 when opened in xl 97
in that I am getting a variety of "Unable to set the ..." errors, such as
"Unable to set the locked property of the Range class" or "Unable to set the
hidden property of the range class".

I did some Goggle groups searches on this group, and the latter error (which
was the error I encountered) seemed to be because I was trying to hide 5
rows that were either locked or protected or both. When I selected the
entire sheet and 'unlocked' the cells (as well as the fact that the sheet
wasn't protected anyway) and tried again with my procedure to hide the rows
and I still got the same error, I came across this procedure

Private Sub CommandButton3_Click()

Dim myDoc As Worksheet
Dim cel As Range
Set myDoc = ActiveSheet
myDoc.Unprotect
For Each cel In myDoc.UsedRange
cel.Locked = False
Next
End Sub

which I tried to use to clear any locking or protection problems, but now
I'm getting the first error I listed above.
What's going on?
Thanks
Matt


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default "Unable to set the ..." in Excel 97

Set the takefocusonclick property of the commandbutton to False.

--
Regards,
Tom Ogilvy

"Matt Jensen" wrote in message
...
Howdy
I'm having some problems with my file created in xl2002 when opened in xl

97
in that I am getting a variety of "Unable to set the ..." errors, such as
"Unable to set the locked property of the Range class" or "Unable to set

the
hidden property of the range class".

I did some Goggle groups searches on this group, and the latter error

(which
was the error I encountered) seemed to be because I was trying to hide 5
rows that were either locked or protected or both. When I selected the
entire sheet and 'unlocked' the cells (as well as the fact that the sheet
wasn't protected anyway) and tried again with my procedure to hide the

rows
and I still got the same error, I came across this procedure

Private Sub CommandButton3_Click()

Dim myDoc As Worksheet
Dim cel As Range
Set myDoc = ActiveSheet
myDoc.Unprotect
For Each cel In myDoc.UsedRange
cel.Locked = False
Next
End Sub

which I tried to use to clear any locking or protection problems, but now
I'm getting the first error I listed above.
What's going on?
Thanks
Matt




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default "Unable to set the ..." in Excel 97

%$^&*&^*
Unbelievable!! Why is it like that?
(I actually just activated range A1 in the worksheet in the VBA procedure
code to fix it)
Thanks
Matt

"Tom Ogilvy" wrote in message
...
Set the takefocusonclick property of the commandbutton to False.

--
Regards,
Tom Ogilvy

"Matt Jensen" wrote in message
...
Howdy
I'm having some problems with my file created in xl2002 when opened in

xl
97
in that I am getting a variety of "Unable to set the ..." errors, such

as
"Unable to set the locked property of the Range class" or "Unable to set

the
hidden property of the range class".

I did some Goggle groups searches on this group, and the latter error

(which
was the error I encountered) seemed to be because I was trying to hide 5
rows that were either locked or protected or both. When I selected the
entire sheet and 'unlocked' the cells (as well as the fact that the

sheet
wasn't protected anyway) and tried again with my procedure to hide the

rows
and I still got the same error, I came across this procedure

Private Sub CommandButton3_Click()

Dim myDoc As Worksheet
Dim cel As Range
Set myDoc = ActiveSheet
myDoc.Unprotect
For Each cel In myDoc.UsedRange
cel.Locked = False
Next
End Sub

which I tried to use to clear any locking or protection problems, but

now
I'm getting the first error I listed above.
What's going on?
Thanks
Matt






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default "Unable to set the ..." in Excel 97

It is a bug in Excel 97 fixed in later versions.

--
Regards,
Tom Ogilvy

"Matt Jensen" wrote in message
...
%$^&*&^*
Unbelievable!! Why is it like that?
(I actually just activated range A1 in the worksheet in the VBA procedure
code to fix it)
Thanks
Matt

"Tom Ogilvy" wrote in message
...
Set the takefocusonclick property of the commandbutton to False.

--
Regards,
Tom Ogilvy

"Matt Jensen" wrote in message
...
Howdy
I'm having some problems with my file created in xl2002 when opened in

xl
97
in that I am getting a variety of "Unable to set the ..." errors, such

as
"Unable to set the locked property of the Range class" or "Unable to

set
the
hidden property of the range class".

I did some Goggle groups searches on this group, and the latter error

(which
was the error I encountered) seemed to be because I was trying to hide

5
rows that were either locked or protected or both. When I selected the
entire sheet and 'unlocked' the cells (as well as the fact that the

sheet
wasn't protected anyway) and tried again with my procedure to hide the

rows
and I still got the same error, I came across this procedure

Private Sub CommandButton3_Click()

Dim myDoc As Worksheet
Dim cel As Range
Set myDoc = ActiveSheet
myDoc.Unprotect
For Each cel In myDoc.UsedRange
cel.Locked = False
Next
End Sub

which I tried to use to clear any locking or protection problems, but

now
I'm getting the first error I listed above.
What's going on?
Thanks
Matt








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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"Unable to Read File" error message in Excel - solutions? Presby Loaner Excel Discussion (Misc queries) 2 June 27th 07 05:09 PM
i am unable to find "Text to speech" tool bar in Office2007 excel Mowrya Excel Discussion (Misc queries) 1 April 2nd 07 10:52 AM
unable to load "Excel" analysis toolpak tried the tools and brows excel analysis toolpak Excel Discussion (Misc queries) 4 November 11th 05 05:01 AM
"Unable to Open File" - excel output of Datagrid <-help needed Steve Chatham[_2_] Excel Programming 0 February 25th 04 07:59 PM


All times are GMT +1. The time now is 04:39 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"