ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protected Worksheets (https://www.excelbanter.com/excel-programming/292389-protected-worksheets.html)

Shamsul Islam

Protected Worksheets
 
Hi

I have a workbook I want to send to other users. This
workbook has protected worksheets. The worksheets have to
be password protected.

How do I create a macro which will unprotect and after
completed the task protect the worksheet without asking
the user for the password I have set.

Regards

Sham



Tom Ogilvy

Protected Worksheets
 
Look in excel help at the protect and unprotect method.

If using xl2000 or earlier, you can set the userinterfaceonly property to
true and your macro can manipulate the worksheet. In xl2002 and later, you
have to supply the password to set this. You would include the password in
your code. Then protect the project in the VBE so the user can not see the
code.

--
Regards,
Tom Ogilvy

"Shamsul Islam" wrote in message
...
Hi

I have a workbook I want to send to other users. This
workbook has protected worksheets. The worksheets have to
be password protected.

How do I create a macro which will unprotect and after
completed the task protect the worksheet without asking
the user for the password I have set.

Regards

Sham





No Name

Protected Worksheets
 
How do you include the password in the code?

-----Original Message-----
Look in excel help at the protect and unprotect method.

If using xl2000 or earlier, you can set the

userinterfaceonly property to
true and your macro can manipulate the worksheet. In

xl2002 and later, you
have to supply the password to set this. You would

include the password in
your code. Then protect the project in the VBE so the

user can not see the
code.

--
Regards,
Tom Ogilvy

"Shamsul Islam"

wrote in message
...
Hi

I have a workbook I want to send to other users. This
workbook has protected worksheets. The worksheets have

to
be password protected.

How do I create a macro which will unprotect and after
completed the task protect the worksheet without asking
the user for the password I have set.

Regards

Sham




.


Tom Ogilvy

Protected Worksheets
 
Activesheet.Protect Password:="ABCD"

--
Regards,
Tom Ogilvy


wrote in message
...
How do you include the password in the code?

-----Original Message-----
Look in excel help at the protect and unprotect method.

If using xl2000 or earlier, you can set the

userinterfaceonly property to
true and your macro can manipulate the worksheet. In

xl2002 and later, you
have to supply the password to set this. You would

include the password in
your code. Then protect the project in the VBE so the

user can not see the
code.

--
Regards,
Tom Ogilvy

"Shamsul Islam"

wrote in message
...
Hi

I have a workbook I want to send to other users. This
workbook has protected worksheets. The worksheets have

to
be password protected.

How do I create a macro which will unprotect and after
completed the task protect the worksheet without asking
the user for the password I have set.

Regards

Sham




.





All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com