View Single Post
  #4   Report Post  
Joseph Geretz
 
Posts: n/a
Default

Another problem we're seeing with worksheet protection is that if the
worksheet is already protected with an unknown password, then our own
protection fails. We can't rely though on the original protection since the
original protection almost always leaves certain fields editable, and we
want the sheet to be read-only in its entirety.

Thanks for your help,

- Joe Geretz -

"Joseph Geretz" wrote in message
...
Thanks Stephen,

The VBA widgets each have a Locked property, which is independent of the
worksheet protection.


Is there a way to get access to the collection of Widgets so that I can
cycle through them and lock them?

Or maybe there's an easier way to do what I'm trying to do. We're
implementing an Excel Viewer window inside our application. Right now
we're actually using the Excel Viewer application, but it's klunky
launching an external application and then finding and embedding the
window via API. We'd much prefer using Excel itself via automation but
we're finding what should be a simple operation (setting the sheets to be
read only) to be more complex than we had anticipated. Unless I've missed
something?

(I played around with m_AppExcel.Interactive = False but this left the
cursor as an hourglass and left the entire worksheet unresponsive to *any*
input to the extent that even the scrollbars are dead. Not good.)

Thanks for your help,

- Joe Geretz -

"Stephen Bullen" wrote in message
...
Hi Joseph,

Is it possible to set protection on the entire workbook in one atomic
operation, or do I need to set the protection for each sheet separately,
as
I am doing? And is there a more efficient way of setting the appearance
style for every worksheet or must I cycle through them individually as I
am
doing?


No, we're pretty much stuck with cycling through them as you're doing.

Anyway, here's my main question: With this approach I am able to lock
the
contents of all cells, but this does not lock embedded VBA widgets, e.g.
Checkboxes, Command Buttons, etc. How can I lock these objects as well?


The VBA widgets each have a Locked property, which is independent of the
worksheet protection.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk