• Project Protecion (2000/XP)

    Author
    Topic
    #400998

    I have locked a project for viewing and have set a password to view the project properties. This is working fine on my machine, I can access the code using the password I have set. I have distributed the excel file with the code to users who are able to work with the file, however on exiting the file the users are being prompted to enter the VBA Project password? They can click on Cancel twice and the message goes away but does anyone know why this might be happening?

    Viewing 3 reply threads
    Author
    Replies
    • #786724

      My guess is that the file has changed and Excel will not save the file unless given the password.

    • #786725

      My guess is that the file has changed and Excel will not save the file unless given the password.

    • #788613

      If you do something in the code that “changes” (according to Excel) the file with the code, then you get prompted to save that file and therefore the password is needed. You can avoid that by adding a line of code that sets the Saved flag.
      Personally I don’t have much experience with Excel VBA, but I suppose it’s not too different from Word VBA. So depending on the actual situation the line of code can be either:
      ActiveWorkbook.Saved = True
      Workbooks(i).Saved = True (i = indexnumber)
      Workbooks(“name.xls”).Saved = True (replace with actual name of file)
      etc.

      Place this line of code after the code that “changes” the file, or place it in an AutoClose Sub.

      Regards,
      Jan

    • #788614

      If you do something in the code that “changes” (according to Excel) the file with the code, then you get prompted to save that file and therefore the password is needed. You can avoid that by adding a line of code that sets the Saved flag.
      Personally I don’t have much experience with Excel VBA, but I suppose it’s not too different from Word VBA. So depending on the actual situation the line of code can be either:
      ActiveWorkbook.Saved = True
      Workbooks(i).Saved = True (i = indexnumber)
      Workbooks(“name.xls”).Saved = True (replace with actual name of file)
      etc.

      Place this line of code after the code that “changes” the file, or place it in an AutoClose Sub.

      Regards,
      Jan

    Viewing 3 reply threads
    Reply To: Project Protecion (2000/XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: