LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Why doesnt this work?

Dim MainWorksSheet As Worksheet
Set MainWorksSheet = ThisWorkbook.Worksheets("Main") *Yes the
worksheet is named Main.

MainWorksSheet.CommandButtonAdd.Enabled = True
MainWorksSheet.CommandButtonMakeBusy.Caption = "Start"

**Both being a button created with the control toolbox.

I get the error : Method or Data member not found.

On the other hand :

ActiveSheet.CommandButtonAdd.Enabled = True
ActiveSheet.CommandButtonMakeBusy.Caption = "Start"

Works fine! Unless the focus is on a different sheet named something
else.

I need to make sure that it refers to the sheet "Main" because I have
other sheets and if they have the focus then the ActiveSheet doesnt
work either.
Thanks for any help.

 
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
Why doesnt this work? MurrayBarn Excel Worksheet Functions 2 November 19th 09 04:21 PM
PASTE DOESNT WORK robin l Excel Worksheet Functions 9 April 18th 09 06:27 PM
Why doesnt this work steve New Users to Excel 1 March 3rd 08 04:52 PM
Why doesnt my filter work!!!!! law Excel Discussion (Misc queries) 2 December 3rd 07 07:48 PM
TAB Key doesnt work. Murat D. Hekimošlu Excel Programming 1 January 25th 05 10:48 AM


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