Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can't insert any controls on an unprotected worksheet

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can't insert any controls on an unprotected worksheet

Update:
If I copy the sheets to a new workbook, the controls re-appear.


---
Message posted from http://www.ExcelForum.com/

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
How to enable the Unprotected Worksheet menu xx Excel Worksheet Functions 1 May 15th 09 12:50 PM
how to navigate through unprotected cells only in a worksheet VictorO New Users to Excel 2 October 24th 08 12:11 AM
Delete unprotected cells in protected worksheet Len Silva Excel Worksheet Functions 1 July 30th 08 02:24 PM
Why would you be unable to rename an unprotected worksheet? LBORDERS Excel Discussion (Misc queries) 2 August 17th 06 12:46 AM
Messagebox: Alert user Worksheet is Unprotected Maria[_6_] Excel Programming 4 November 5th 03 04:34 AM


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