Can't insert any controls on an unprotected worksheet

M

mikeang

Strange problem ... Excel 2002 SP2 Win2000
I have written code to query a SQL db using ADO ... works great!
The workbook consists of several worksheets ... some are hidden an
some not.
My code will hide certain sheets when:

Private Workbook_Activate()
shtTodayHours.Visible = xlSheetHidden

and protect others ...

With shtPunches
.Protect Contents:=True, UserInterfaceonly:=True
.EnableSelection = xlNoSelection
End With

then I reverse the process ...

Private Sub Workbook_Deactivate()
For Each wks In Worksheets
wks.Visible = True 'unhide all worksheets
wks.Unprotect
next wks

My problem is that I had a few buttons and checkboxes on some sheet
that were only hidden, not protected that have disappeared sometim
during the testing of my code and I can't replace them. All sheets ar
not protected and the workbook is not either (and never was) but th
controls on the Forms & Control Toolbox are grayed out (except Toggl
Grid on the Forms & Design Mode, Properties, and View Code on th
Control Toolbox) so I can't add any new controls.
If I Insert a new worksheet into the existing workbook, I still can'
add any controls. If I create a New workbook, I can add control
there.

Any ideas what has happened?

Mike Angellotti:confused
 

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