LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default R/T 1004 - Unable to get Button prop of Ws Class

I have a file (Sheet1 only used) with two Forms Command Buttons, with
Captions ToProtectWB and ToUnprotectWB. I want one to be enabled
and the other disabled according to the current setting. This is what I now
have **which is producing R/T 1004**. Can someone assist me?

Sub ToProtectWB()
'
ActiveWorkbook.Protect Password:="password", Structu=True,
Windows:=False
Sheets(1).Buttons("Protect WB").Enabled = False
Sheets(1).Buttons("Unprotect WB").Enabled = True
End Sub
Sub ToUnprotectWB()
'
ActiveWorkbook.Unprotect Password:="password"
Sheets(1).Buttons("Unprotect WB").Enabled = False
Sheets(1).Buttons("Protect WB").Enabled = True
End Sub
 
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
Runtime 1004 error -- insert method of range class failed. tish Excel Discussion (Misc queries) 1 June 1st 07 04:04 PM
Run-Time error '1004' : Select method of Range class failed [email protected] Excel Discussion (Misc queries) 3 March 9th 07 01:36 PM
Unable to set the Values property of the Series class rafael garcia Charts and Charting in Excel 1 September 25th 06 04:31 PM
Unable to set the formula property of the series class Malhar Charts and Charting in Excel 1 July 24th 06 05:50 PM
Unable to set the XValues property of the Series class ramkumar_cpt Charts and Charting in Excel 5 November 29th 05 02:13 PM


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