Lock-Protect documents

Excel 2002 sp2

How do you protect cells from being edited?  I need to lock/protect all but
4 cells from being edited on a worksheet.  I go into the 'format cells'
properties of the 4 cells and 'unlock' them, and go into the 'format cells'
properties of the rest and lock them.  Then I go to tools, protection,
protect sheet, I add a password and check only 'unlocked cells'.  This isn't
doing it, I can still edit the sheet, I emailed it to someone else and he
can edit the sheet.  What am I doing wrong?  Thank you!


0
subscribe (8)
7/15/2003 3:05:59 PM
excel 39879 articles. 2 followers. Follow

1 Replies
434 Views

Similar Articles

[PageSpeed] 41

You could prompt for a password using an inputbox, but the user's entry will be
visible.  You could design your own userform to mask the characters (if you
wanted).

See if these give you any ideas:
Option Explicit
Sub testme01()
    Dim myPwd As String
    Dim wks As Worksheet
    Set wks = Worksheets("sheet1")
    With wks
        If .ProtectContents _
         Or .ProtectDrawingObjects _
         Or .ProtectScenarios Then
            myPwd = InputBox(prompt:="What's the frequencey, Kenneth?", _
                        Title:="Getting Password")
            On Error Resume Next
            .Unprotect Password:=myPwd
            If Err.Number <> 0 Then
                MsgBox "Invalid password"
                Err.Clear
            End If
            On Error GoTo 0
        End If
    End With
End Sub

Sub testme02()
    Dim wks As Worksheet
    Set wks = Worksheets("sheet1")
    With wks
        If .ProtectContents _
         Or .ProtectDrawingObjects _
         Or .ProtectScenarios Then
            On Error Resume Next
            Application.Dialogs(xlDialogProtectDocument).Show
            If Err.Number <> 0 Then
                MsgBox "Invalid password"
                Err.Clear
            End If
            On Error GoTo 0
        End If
    End With
End Sub

The second one just shows the built in dialog.  You may want just teach people
how to use Tools|Protection.  It'll be something that they can use on other
workbooks, too.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Michael Miazga wrote:
> 
> Not sure why it wasn't working, but got it to work doing it this way.
> 
> Not too experienced with Macros, I want to write one that protects the sheet
> and asks the user for a password.  Anyone done this?
> 
> "Michael Miazga" <subscribe@etwd.com> wrote in message
> news:ejfXbKuSDHA.1912@TK2MSFTNGP12.phx.gbl...
> > Excel 2002 sp2
> >
> > How do you protect cells from being edited?  I need to lock/protect all
> but
> > 4 cells from being edited on a worksheet.  I go into the 'format cells'
> > properties of the 4 cells and 'unlock' them, and go into the 'format
> cells'
> > properties of the rest and lock them.  Then I go to tools, protection,
> > protect sheet, I add a password and check only 'unlocked cells'.  This
> isn't
> > doing it, I can still edit the sheet, I emailed it to someone else and he
> > can edit the sheet.  What am I doing wrong?  Thank you!
> >
> >

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
7/15/2003 10:40:07 PM
Reply:

Similar Artilces:

Accessing Spreadsheet Documents (Works Suite 2003)
I recently converted over from a Mac to Windows. I had several spreadsheet documents that I converted using Maclink. They converted over okay. But, when I try to use them, and then wanted to save them, I have to save in Works 7.0. Then when I try to open them up I get the following type message: BUW1, contains a formula reference outside the area that Works can access. There are other similiar references like: LDI1, KMS1, AND MX1. I do not know how to remove these problems so that I may utilize the documents. Please help. Thanks. JB I'd suggest asking this in a Works gr...

can I turn off snychronous scrolling when comparing 2 documents
I want to compare 2 documents in word using the side by side view. Using snychronous scrolling, both documents move together. I need to move through each document separately while still looking at them side by side. Can I turn off the snychronous scrolling? On the Compare Side by Side toolbar that appears when you start the Side by Side activity there is an icon called Synchronous Scrolling, click this once, and you can know scroll one or the the other document independently, click it again and the synchronous scrolling will start again. Hope this helps DeanH "jt...

Locked Fields
On the quote log entity the fields refering to shipping addresses are all mandatory locked fields and I want to get rid of them. How do I do that? On Nov 26, 5:46 pm, DMT <D...@discussions.microsoft.com> wrote: > On the quote log entity the fields refering to shipping addresses are all > mandatory locked fields and I want to get rid of them. > > How do I do that? DMT- Settings > Customization > Quotes > Attributes > and remove the constraint from each of the fields from that section. Business Req'd , Recommended, or No Constraint. Set any/all relativ...

Pasword protected Excel file encrypted, how do I read this file?
I password protected an important file. My husband downloaded the Office 2003 upgrade last night. Now when I try to access the file I get this message...This is an Excel file, I don't know why it looks encrypted or why I can't access it. This file is not in a recognizable format. If you know the file is from another program which is incompatible with Microsoft Office Excel, click Cancel, then open this file in its orginal application. If you want to open the file later in Microsoft office Excel, save it in a format that is compatible, such as text format. If you suspect the...

locking tabs w/macros
i have a workbook that employees use to track project progress. they enter project data into sheet 1 and vbscript macros manipulate this data and output it in various ways on worksheets 2-15. i want to lock sheets 2-15 so employees cannot enter data, but when i protect those sheets the macros are no longer permitted to work. is there a way i can prevent cell editing by USERS but permit editing by MACROS? this seems like it should be fairly obvious, but i cant figure it out. thanks in advance! Hi eric, 1) you might want to use the following instruction when protecting the sheets: ...

Opening Office 2010 beta documents with Office 2003
The header says it all. I tried a "patch" or converter I found on the Microsoft web site and installed it, but I get errors that there is not enough memory to open the application. The particular file I am trying to open is an excel file created using a beta copy of MS Office 2010. Office 2003 is a certified, activated, registered release. Is there a file converter for this or do I just have to wait until Microsoft comes out with the final release? Really, I wish there would be SOME backward compatibility with Microsoft's Office products. It seems that whe...

Publisher document in email
Created a marketing piece that I would like to email to clients. Looking for a way to send it without the tool bars, ruler marking, etc. that appear when opened. Would like for the recipient to see the document without these things. Guidance sought. Working with Publisher 2003 PDF? There are free converters around. www.primopdf.com has been mentioned here. -- Mary Sauer http://msauer.mvps.org/ "Maurice" <Maurice@discussions.microsoft.com> wrote in message news:0ABAC7A8-0439-40DA-A6B0-E9DA83A73542@microsoft.com... > Created a marketing piece that I would like to em...

how do I open documents created in publisher on my Ipaq 2495
I cannot open a document created in publisher 2002 on my Ipaq 2495. I get a message that tells me to run the application first. What does this mean? I can open a document created with Word. I don't think the there is a mobile version of Publisher. At least I've never heard of one. -- JoAnn Paules MVP Microsoft [Publisher] "becki" <becki@discussions.microsoft.com> wrote in message news:1E0C792F-9BF1-4C01-AB99-0462A22399A1@microsoft.com... >I cannot open a document created in publisher 2002 on my Ipaq 2495. I get a > message that tells me to run the app...

inserting equations in Word document from MathType not working anymore
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I've just starting using Snow Leopard after worked with Tiger previously. I'm noticing some odd behavior that's different than before. <br><br>I have the MathType 6 Insert Eqn button installed in Office 2008 for Mac. When I click on that, MathType opens. So far, so good. I type in my equation, but, when I'm finished editing or creating my equation, I'm used to clicking on the red button to close the MathType window and return to my Word document. When I do that now, my Word d...

Locked problem when using .Clear
I am using the following to Clear a group of cells; Range("AP1:AP1500").Clear however, after using this code I notice that the cells are Locked rather than Unlocked as they were originally - this then causes problems in other code I have running as the sheet is protected when distributed. Is there something elase I can do to solve the problem ? Thanks Hi, > Is there something elase I can do to solve the problem ? Post all you code because that line of code won't change the locked status of the cells. -- Mike When competing hypotheses are otherwise...

protect formulas without password
is there a way i can protect the formulas without protecting and passwording and identifying various ranges? the user accidentally enters data into a calculated cell and wipes out the formula. thank you, mike g Mike, Set the cells that the user can change to unlocked using Format, Cells, Protection, set those they can't to locked. Protect the Sheet. Robin Hammond www.enhanceddatasystems.com "work" <mike@radiant.net> wrote in message news:42140299.10B3@radiant.net... > is there a way i can protect the formulas without protecting and > passwording and identifying ...

Applying the same macro to multiple Visio documents
Hi, I have created a macro which allows me to convert some of the information in my visio documents to text file. The problem is that I have dozens of visio files which I need to apply this macro to in order to create text files for each of these files. Is there an easy way in which I can apply the macro to all these files? Maybe there is a quick way of loading a macro into an visio document so that it runs when you open the visio file. Thanks for your help, Barry. There is an example of looping through a directory of Visio files at visio.mvps.org/3rdparty.htm. Look at the second item la...

Outlook Lock Up
I am trying to open my Outlook 2000. It begins to open but then locks up at the initial stages and I have to press Control, ALt and Delete and notice that it is using 96-99% of my CPU. It will not open. What can I do to open? Help? Close Outlook. Find and rename outcmd.dat to .old. (If using Windows 2000 or XP, you will need to enable searching hidden and system folders.) Once you have done so, reopen Outlook and it should open fine. You will need to rebuild any custom toolbars or customizations as the file outcmd.dat controls how the toolbars display. When it becomes corrupted, it w...

Unsaved document
Is there any way to recover a document that was closed without saving? It seems like I have done this before and now I can not retriev it. Nope. "msawr5250" <msawr5250@discussions.microsoft.com> wrote in message news:27E38D72-9334-4A9B-8B91-8742269F710C@microsoft.com... : : Is there any way to recover a document that was closed without saving? It : seems like I have done this before and now I can not retriev it. If it was not saved, there is nothing to retrieve. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http:/...

Outlook locks up #13
I have appointments in Outlook 2002 going back several years. I can access old apppointments in the "Active Appointments" view, but when I try to go back more than two years in the "Day/Week/Month" view, Outlook locks up, consuming 95%+ of the CPU. I have tried a repair/detect. It had no effect. Any ideas? -- Dave Have you tried running ScanPST.EXE on your PST file to see if its corrupt? "Dapper Dave" <expurgated@gmail.com> wrote in message news:i66el2tt9mmnn4kqomjsk7hnig7g0mbqpm@4ax.com... >I have appointments in Outlook 2002 going back several ye...

Document no longer exist in originating module
Hi, Sometimes a getting this message: "Document no longer exists in originating module" when I tried to click on "Cash Receipts" for Customer. This receipt exist but not fully distributed. I tried to reconcile and so on all documents. Nothing. Thank you Vitali, Have you tried check links as well? When you say 'not fully distributed', what exactly do you mean? -- Victoria Yudin Microsoft MVP - Great Plains "Vitali V" <vitvov@dynamo-ny.com> wrote in message news:u0$0CW2IFHA.904@tk2msftngp13.phx.gbl... > Hi, > > Sometimes a gettin...

How do I unlock specific cells in a spreadsheet that I protected? #2
I have a spradsheet that I protected and I now want to unlock some specific cells so my users can update the cells. I tried to do this by going to Format then Cells and so on, but when I clicked on the Format tab then on the Cell option, the cell option is grayed out(not active). What is causing this and is there a work around?....Tks, MM By default all cells are locked when the sheet is protected. First, you must Unprotect the sheet via Tools>Protection>Unprotect sheet. Then.......... Select the cells you wish to unlock and Format>Cells>Protection. Check "unlocked&q...

Deleting to the end of the document
I want to use VBA to delete everything following my present position in the document to the very end. How is that done? "LA Lawyer" <LALawyer@discussions.microsoft.com> wrote in message news:8C996D3B-846F-419C-A8D4-782FE3721877@microsoft.com... >I want to use VBA to delete everything following my present position in the > document to the very end. > > How is that done? Selection.MoveEnd Unit:=wdStory, Count:=1 Selection.Delete -- Regards Jonathan West ...

how to write on the back of my document ?
when you have the document up how to do you write on the back of it ? please hlep thank you in advance Page 2 -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "guy in need of help" <guy in need of help@discussions.microsoft.com> wrote in message news:C6EE6F9E-9938-4736-A848-1B31A4A719E0@microsoft.com... > when you have the document up how to do you write on the back of it ? > please > hlep thank you in advance What version Publisher? When you insert a page, is there page tabs at the bottom of th...

Locking picture frames
How do I lock the size of a picture frame so it doesn't resize when a large picture is inserted. Can't find it anywhere with the app (Publisher 2003) Thanks. Create a one cell table, fill, fill effects, picture tab. You can designate the size of the table, right-click the table, format table, size tab. Picture frames will stay about the size you designate, they only change proportionally. The best way to minimize the changing of the frame is to right-click the frame, click change picture and browse to the file. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.m...

Protecting Excel Formulas
Can anyone help with the protection of part of an Excel worksheet (Excel 2003)whilst still allowing sorting and filtering of data? Individual users paste data into the worksheet and, despite comprehensive instructions, sometimes manage to delete / overwrite existing formulas. The individual users need to sort and filter the whole worksheet after their "input" so the basic procedure of locking and protecting the cells containing the formulas isn't an option. Any help would be most welcome. If users input data to w/sheets they do not need access to cells containing ...

Create SplitterWnd with 2 different documents
I've looking some samples of SplitterWnd, but they all refers to one child-one doc-multiple views. I need something like one child-multiple docs-one view per doc. Has anybody seen something like this before? Is it possible to be done under Doc/View architecture? Thanks a lot for your attention and help Alvaro Palma wrote: > I've looking some samples of SplitterWnd, but they all refers to one > child-one doc-multiple views. I need something like one child-multiple > docs-one view per doc. Has anybody seen something like this before? Is it > possible to be done under Doc/...

How to remove DRM Protection from WMV/WMA/M4P/M4V/M4A/M4B/ASF and convert other popular video and audio even HD video 07-15-10
The guide shows How to remove DRM Protection from WMV/WMA/M4P/M4V/M4A/M4B/ASF and convert other popular video and audio even HD video Stpe 1: Download(http://www.5idownload.com/download/daniu-digital-media-converter-pro_full310_461741.exe) and install the Daniusoft Media Converter Pro( http://www.5idownload.com/dan-Media-Converter-pro.html ) Stpe 2: Run the software and click "Add…" button to load WMA or M4A, M4B, AAC, WMV, M4P, M4V, ASF files ( http://www.5idownload.com/img/guide-dan-media-converter-pro1.jpg) Step 3: Choose output formats. If you want to convert protected aud...

global address missing when sending word document as email attachment
Hi All, Im having trouble with my email, Im just wondering if you guys could help me... I use Outlook 2000 as my email browser. It started recently when you create a ms word document and go to: File - send to mail receipient or mail receipient as an attachement outlook does open ok except when I select the TO button I do not get my global address book (company address book), I get nothing. Any help I would really appreciate it. Thanks in advance... .. What do you show when you press the TO: button? Does the GAL appear in the dropdown list at all? What does show there? --� Milly ...

Trouble validating cXML documents with cXML.dtd using XmlValidatingReader
Hi, [I just found this group. I had originally posted this in microsoft.public.xml but figured this group was more appropriate. Please excuse the cross-post.] I am trying to validate cXML documents against cXML.dtd using the XmlValidatingReader. If I set the XMLValidatingReader's ValidatingType to ValidationType.DTD, I get the following System.Xml.Schema.XmlSchemaException: "The parameter entity replacement text must nest properly within markup declarations. An error occurred at http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd, (3009, 29)." I have seen a post regarding thi...