Consulting

Results 1 to 11 of 11

Thread: Please password protect my file

  1. #1

    Please password protect my file

    Hi, I'm just a newbie here.. Could someone please help me password protect my file without destroying the drop-downs and macro.. i need the yellow fields to remain unprotected so other users can be allowed input. Thanks in advance!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Didn't I do that previously?

    Have you tried Googling it?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    hi xld. actually i noticed that when we hid the index tab, the macro for my row 12 (Vendor Account Group) which supposedly changes the choices available depending on the country i choose-does not work. i dont know if it's because my data for the combo box are on the INDEX tab. Kindly have a look again please. here's the original file i sent on the separate thread i posted.

    http://www.vbaexpress.com/forum/showthread.php?t=33519

    on the file you returned on your reply, the macro for row 12 does not work anymore..

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    That is a completely different question!

    I can see that your dropdowns refer to macros in the original, which I didn't spot yesterday, but none of those macros exist, so the selection triggers nothing, which is what I found on testing and why I thought they were just data selections. In other words, the code isn't there!
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    oh alright.. that is weird.. so could you help me with my problem? i know this is just simple for experts like you and im a total VBA dummy so please forgive me if I may seem naive to you..

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    The code that is in the file, even though nothing seems to call it, just seems to build a dependent list. Why don't you just use INDIRECTed lists as you have elsewhere?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    hmmm.. i'l go ahead and give it a try.. thanks for that!

    by the way, is there a way where a message box will appear in case some of the cells will not be filled-out completely by the user? like for example, i want specific cells to be like required fields and the user will not be able to save the file unless these required fields are all completely filled-in?

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You will need to trap the BeforeSave event for that.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  9. #9
    how do i do that?

  10. #10
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
    Cancel As Boolean)

    On Error GoTo wb_exit
    Application.EnableEvents = False

    'change the following code to apply to your sheet/fields
    With Worksheets("Sheet1")

    If .Range("A1").Value2 = "" And .Range("H5").Value = "" Then

    Cancel = True
    End If
    End With
    wb_exit:
    Application.EnableEvents = True
    End Sub
    [/vba]

    This is workbook event code.
    To input this code, right click on the Excel icon on the worksheet
    (or next to the File menu if you maximise your workbooks),
    select View Code from the menu, and paste the code
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  11. #11
    thank you so much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •