PC Review


Reply
Thread Tools Rate Thread

controlformat.enabled failed in excel macro

 
 
DAACKM
Guest
Posts: n/a
 
      15th Sep 2008
I have a form with a checkbox(enabled) and a scrollbar(disabled). The
checkbox is assigned to a macro which has the following line of code which is
attempting to enable the scrollbar:

ActiveWorkbook.Sheets(sheetname).Shapes(slidername).ControlFormat.Enabled

But when executed, I get "Enabled method of Scrollbar class Failed". The
values for sheetname and slidername look OK. Any ideas?
--
Dave Ackmann
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      15th Sep 2008
If the scrollbar was from the Forms toolbar, I could use:
Worksheets("sheet1").ScrollBars("Scroll bar 1").Enabled = False

If the scrollbar was from the Control toolbox toolbar, I'd use:
Worksheets("Sheet1").OLEObjects("Scrollbar1").Object.Enabled = False

DAACKM wrote:
>
> I have a form with a checkbox(enabled) and a scrollbar(disabled). The
> checkbox is assigned to a macro which has the following line of code which is
> attempting to enable the scrollbar:
>
> ActiveWorkbook.Sheets(sheetname).Shapes(slidername).ControlFormat.Enabled
>
> But when executed, I get "Enabled method of Scrollbar class Failed". The
> values for sheetname and slidername look OK. Any ideas?
> --
> Dave Ackmann


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Macro-enabled Workbook Salza Microsoft Excel Misc 2 16th May 2010 03:57 AM
Excel Macro-enabled Worksheet VBA_Newb Microsoft Excel Misc 0 10th Mar 2010 03:52 PM
Creating macro enabled Excel 2007 workbook Ken Warthen Microsoft Excel Programming 2 19th Sep 2009 06:32 PM
macro enabled excel worksheet running very slow. Bill R Microsoft Excel Misc 0 21st May 2009 07:26 PM
ThisWorkbook.Saved = True does not work when Shapes().ControlFormat.Enabled = False Joe HM Microsoft Excel Programming 0 3rd Aug 2006 07:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:57 AM.