controlformat.enabled failed in excel macro

D

DAACKM

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?
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top