Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default changing button prop with vba

I have set a buttons enable property to false for startup and am now trying
to enable the button. It is directly on the worksheet and named
btnReconciliation I have tried the following.

Sub EnableReconcil()
ActiveSheet.btnReconciliation.enable = True
'Runtime error 438 Object dosn't support this property or message

ActiveSheet.Buttons("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class

ActiveSheet.OLEObjects("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class
End Sub

any ideas what I could do?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default changing button prop with vba

You can not use Activesheet. You need to specifically reference the sheet
that the button is on. Something like this...

Sheet1.btnReconciliation.enable = True

--
HTH...

Jim Thomlinson


"Arnold Klapheck" wrote:

I have set a buttons enable property to false for startup and am now trying
to enable the button. It is directly on the worksheet and named
btnReconciliation I have tried the following.

Sub EnableReconcil()
ActiveSheet.btnReconciliation.enable = True
'Runtime error 438 Object dosn't support this property or message

ActiveSheet.Buttons("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class

ActiveSheet.OLEObjects("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class
End Sub

any ideas what I could do?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default changing button prop with vba

Actually that is not true, you can use the activesheet but it is not good
practice, so always reference it explicitly, See my other post for the fix
which is actually a typo which should use Enabled property not enable

--
Cheers
Nigel



"Jim Thomlinson" wrote in message
...
You can not use Activesheet. You need to specifically reference the sheet
that the button is on. Something like this...

Sheet1.btnReconciliation.enable = True

--
HTH...

Jim Thomlinson


"Arnold Klapheck" wrote:

I have set a buttons enable property to false for startup and am now
trying
to enable the button. It is directly on the worksheet and named
btnReconciliation I have tried the following.

Sub EnableReconcil()
ActiveSheet.btnReconciliation.enable = True
'Runtime error 438 Object dosn't support this property or message

ActiveSheet.Buttons("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet
class

ActiveSheet.OLEObjects("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet
class
End Sub

any ideas what I could do?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default changing button prop with vba

Nice catch. I missed the typo. I figured that the button was not on the
activesheet which caused the problem... you are absolutely correct.
--
HTH...

Jim Thomlinson


"Nigel" wrote:

Actually that is not true, you can use the activesheet but it is not good
practice, so always reference it explicitly, See my other post for the fix
which is actually a typo which should use Enabled property not enable

--
Cheers
Nigel



"Jim Thomlinson" wrote in message
...
You can not use Activesheet. You need to specifically reference the sheet
that the button is on. Something like this...

Sheet1.btnReconciliation.enable = True

--
HTH...

Jim Thomlinson


"Arnold Klapheck" wrote:

I have set a buttons enable property to false for startup and am now
trying
to enable the button. It is directly on the worksheet and named
btnReconciliation I have tried the following.

Sub EnableReconcil()
ActiveSheet.btnReconciliation.enable = True
'Runtime error 438 Object dosn't support this property or message

ActiveSheet.Buttons("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet
class

ActiveSheet.OLEObjects("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet
class
End Sub

any ideas what I could do?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default changing button prop with vba

Thank you that worked

ProgramControl.btnReconciliation.Enabled = True

"Jim Thomlinson" wrote:

You can not use Activesheet. You need to specifically reference the sheet
that the button is on. Something like this...

Sheet1.btnReconciliation.enable = True

--
HTH...

Jim Thomlinson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default changing button prop with vba

Try using Enabled not Enable, also to avoid running the code against the
wrong active sheet specify the sheet explicitly

ActiveSheet.btnReconciliation.Enabled = True

or explicitly

Sheets("Sheet1").btnReconciliation.Enabled = True


--
Cheers
Nigel



"Arnold Klapheck" wrote in
message ...
I have set a buttons enable property to false for startup and am now trying
to enable the button. It is directly on the worksheet and named
btnReconciliation I have tried the following.

Sub EnableReconcil()
ActiveSheet.btnReconciliation.enable = True
'Runtime error 438 Object dosn't support this property or message

ActiveSheet.Buttons("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class

ActiveSheet.OLEObjects("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class
End Sub

any ideas what I could do?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default changing button prop with vba

Here are a couple of different ways to enable/disable a commandbutton:

From another worksheet:

Worksheets("Sheet2").CommandButton1.Enabled = True

On the current worksheet
CommandButton1.Enabled = False
-or-
ActiveSheet.CommandButton1.Enabled = False


Hope this helps...

Sandy

Arnold Klapheck wrote:
I have set a buttons enable property to false for startup and am now trying
to enable the button. It is directly on the worksheet and named
btnReconciliation I have tried the following.

Sub EnableReconcil()
ActiveSheet.btnReconciliation.enable = True
'Runtime error 438 Object dosn't support this property or message

ActiveSheet.Buttons("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class

ActiveSheet.OLEObjects("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class
End Sub

any ideas what I could do?


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default changing button prop with vba

Here are a couple of different ways to enable/disable a commandbutton:

From another worksheet:

Worksheets("Sheet2").CommandButton1.Enabled = True

On the current worksheet
CommandButton1.Enabled = False
-or-
ActiveSheet.CommandButton1.Enabled = False


Hope this helps...

Sandy

Arnold Klapheck wrote:
I have set a buttons enable property to false for startup and am now trying
to enable the button. It is directly on the worksheet and named
btnReconciliation I have tried the following.

Sub EnableReconcil()
ActiveSheet.btnReconciliation.enable = True
'Runtime error 438 Object dosn't support this property or message

ActiveSheet.Buttons("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class

ActiveSheet.OLEObjects("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class
End Sub

any ideas what I could do?


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default changing button prop with vba

Here are a couple of different ways to enable/disable a commandbutton:

From another worksheet:

Worksheets("Sheet2").CommandButton1.Enabled = True

On the current worksheet
CommandButton1.Enabled = False
-or-
ActiveSheet.CommandButton1.Enabled = False


Hope this helps...

Sandy

Arnold Klapheck wrote:
I have set a buttons enable property to false for startup and am now trying
to enable the button. It is directly on the worksheet and named
btnReconciliation I have tried the following.

Sub EnableReconcil()
ActiveSheet.btnReconciliation.enable = True
'Runtime error 438 Object dosn't support this property or message

ActiveSheet.Buttons("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class

ActiveSheet.OLEObjects("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class
End Sub

any ideas what I could do?


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default changing button prop with vba

WOW!! not sure what happened sorry for the multiple posts...


Sandy wrote:
Here are a couple of different ways to enable/disable a commandbutton:

From another worksheet:

Worksheets("Sheet2").CommandButton1.Enabled = True

On the current worksheet
CommandButton1.Enabled = False
-or-
ActiveSheet.CommandButton1.Enabled = False


Hope this helps...

Sandy

Arnold Klapheck wrote:
I have set a buttons enable property to false for startup and am now trying
to enable the button. It is directly on the worksheet and named
btnReconciliation I have tried the following.

Sub EnableReconcil()
ActiveSheet.btnReconciliation.enable = True
'Runtime error 438 Object dosn't support this property or message

ActiveSheet.Buttons("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class

ActiveSheet.OLEObjects("btnReconciliation").enable = True
'Runtime error 1004 unable to get buttons property of the worksheet class
End Sub

any ideas what I could do?




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
R/T 1004 - Unable to get Button prop of Ws Class Jim May Excel Discussion (Misc queries) 3 January 2nd 08 05:19 PM
Changing text on a button Brad Excel Discussion (Misc queries) 2 July 27th 07 12:14 PM
prop. scale images - have code, just need slight mod cml0904[_3_] Excel Programming 1 August 19th 06 12:21 AM
TEMPLATE IN EXCEL FOR MONTHLY PAYMENTS FOR MORE THAN ONE PROP tb New Users to Excel 1 January 4th 05 04:20 PM
CommandBarButton.OnAction prop fires when set? Arg! kevin Excel Programming 2 July 22nd 03 10:40 AM


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

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"