Dear all,
I need to protect excel file. I have search vba codes and tried to combine :
1. Must enable macro on open
2. Input user id and password
3. Disable cut, copy, paste and print
but not work.
user : test
password : 1
Details as per attachment
Please suggest...
File Protection With Vba
-
-
Re: File Protection With Vba
You cannot force macros to be enabled on opening.
This earlier post shows how to use a form to control access with a password
-
Re: File Protection With Vba
I mean, if macro disable, only blank sheet is appear and the others are verry hidden. But if macro enable, sheets that contain data are enable, and others verry hidden.
-
Re: File Protection With Vba
Hi,
you first need to unprotect the workbook with VBa, then you simply set the sheets to xlSheetVisible.
If somebody doesn't enable the macro, the workbook is automatic save. Don't forget to set a password on your Vba-code, otherwise somebody can make the sheets visible without providing a password.
-
-
-
Re: File Protection With Vba
thanks for your suggests.
i know nothing about vba. i have to make more simple about this protection,maybe without login password -
Re: File Protection With Vba
Your questions are too vague. You haven't actually stated exactly what you want. I think you want to explain to user's about enabling macros, which the example I pointed to does, then have a password for access. Tackle each issue separately, solve one then post back for help with the next. The Forum Rules actually say you must only ask one question per Thread.
Have a go at the enable macros example, understand that hen ask for help with the password.
-
Re: File Protection With Vba
Sorry for my bad english, i can't describe what i mean.
i use excel to store my data and i want to use login box to restrict user to open,copy and print. but if macro disabled, user still can access the data.
so, i search codes that force macro enable, create login box, prevent copy, cut and print and try to combine it.
because i don't know about vba, now the codes doesn't work.
i can't update password at login box, and many error when open the file.
i have no idea how to make it work. -
Re: File Protection With Vba
Attach your workbook
-
Re: File Protection With Vba
here my workbook
thanks a lot -
-
Re: File Protection With Vba
This last example is no different to the first. There is no code that I can see that you have added that needs correcting.
-
Re: File Protection With Vba
sorry, wrong file
-
Re: File Protection With Vba
You have'nt got the named range "Esers_List", you use xlVisible instead of xlSheetVisible
Also, you are protecting the workbook before any code runs, so you can't hide/unhide sheets.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!