473,395 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Excel 2000 Worksheet Protection

Hi,

I am using the following code to protect the active worksheet:

Excel.Worksheet activeWorkSheet = (Excel.Worksheet)
excelApp.ActiveWorkbook.ActiveSheet;

activeWorkSheet.Protect("password", missing, missing, missing,
missing);

This works fine but i would like to unprotect certain cells so they do
not require the user to unprotect the worksheet before editing.

Any ideas ?

TIA

Luke
Nov 15 '05 #1
2 2907
Luke,

I don't believe that this level of granularity exists. If you protect
the whole worksheet, then I would expect that everything in the worksheet is
protected. If anything, I would put the cells on another worksheet that is
not protected.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"James" <lu**********@hotmail.com> wrote in message
news:d1**************************@posting.google.c om...
Hi,

I am using the following code to protect the active worksheet:

Excel.Worksheet activeWorkSheet = (Excel.Worksheet)
excelApp.ActiveWorkbook.ActiveSheet;

activeWorkSheet.Protect("password", missing, missing, missing,
missing);

This works fine but i would like to unprotect certain cells so they do
not require the user to unprotect the worksheet before editing.

Any ideas ?

TIA

Luke

Nov 15 '05 #2
Sure you can.

Select your range that you want unprotected (I believe by default that cells
are locked) and
then call Select() on that range. Then set Selection.Locked = false, and the
protect the worksheet.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:OR**************@TK2MSFTNGP11.phx.gbl...
Luke,

I don't believe that this level of granularity exists. If you protect
the whole worksheet, then I would expect that everything in the worksheet is protected. If anything, I would put the cells on another worksheet that is not protected.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"James" <lu**********@hotmail.com> wrote in message
news:d1**************************@posting.google.c om...
Hi,

I am using the following code to protect the active worksheet:

Excel.Worksheet activeWorkSheet = (Excel.Worksheet)
excelApp.ActiveWorkbook.ActiveSheet;

activeWorkSheet.Protect("password", missing, missing, missing,
missing);

This works fine but i would like to unprotect certain cells so they do
not require the user to unprotect the worksheet before editing.

Any ideas ?

TIA

Luke


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Geert-Pieter Hof | last post by:
Hello, My VB 6.0 application read and writes data from and to a MS Excel workbook, using the Microsoft.Jet.OLEDB.4.0 provider. Now I want to protect the Excel workbook with a password, but I...
13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
5
by: Axial | last post by:
Question: How to select columns from Excel-generated XML when some cells are empty. I've found examples where rows are to be selected, but I can't seem to extrapolate from that to selecting...
1
by: c duden | last post by:
Excel won't allow documents to be linked to a worksheet in office 2000 when using C# to create an add-in. The following code snippets are what was used in the attempts (there are more...
11
by: Mr. Smith | last post by:
Hello all, My code can successfully open, write to, format and save several worksheets in a workbook then save it by a given name, close and quit excel. My problem is that if I try and do it...
1
by: Steven | last post by:
Hello, I use the following code to make an Excel-file, which works fine with Excel 2003 (and the MS Excel 11.0 object library): Dim Excel As New Excel.Application Dim oBook As...
8
by: Sam | last post by:
Hi All, I posted this message few days ago. No one has answered so far. I just would like to know if it is possible to do or not. Even if you can not tell me how to do this, maybe you know which...
1
by: Randall Arnold | last post by:
I'm converting a vbscript program to vb.net. Witht he exception of .net idiosyncrasies, most of it is working well with the same code. My only problem is that some properties and methods are...
6
by: gumbystation | last post by:
I am looking to take data from an excel spreadsheet into a csharp application to manipulate the data in various ways. Currently, I am using VS2005 (self-taught C#) and Excel 2000. I have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.