Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2008

Tip: Looking for answers? Try searching our database.

Excel, button for macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dg.courbat@gmail.com - 17 Mar 2008 13:55 GMT
Hello,
I have a protected (real password... not just protection wihout
password..) template with a button who star a macro.  The macro change
some informations, use the filters and print the result. When I push
the button, the system ask for the password.
Do you have ideas ?  Thank you for your help.   DG
NB : I don't want put the password in the macro, means unprotect and
protect the worksheet in the macro...
stew - 17 Mar 2008 14:13 GMT
Can you clarify what you mean by Template (i.e. do you have a XLT
template, or just a normal XLS workbook)?

I'm assuming you have used "Protect Sheet" from the Tools menu?

What are trying to protect with the password? If you can explain there
may be alternative approaches. i.e. could you save the file as Read-
Only and then remove the "Protect Sheet" ?
dg.courbat@gmail.com - 17 Mar 2008 14:26 GMT
> Can you clarify what you mean by Template (i.e. do you have a XLT
> template, or just a normal XLS workbook)?
[quoted text clipped - 4 lines]
> may be alternative approaches. i.e. could you save the file as Read-
> Only and then remove the "Protect Sheet" ?

Hello,
It's a template (xlt) I protected the worksheet from Tools menu in
Excel application.
If I just use Tools, Protection, Protect sheet and push the button
"OK" the sheet is protected but wihout password and in this case I
don't have any problem when I execute the macro.
Some people can modify the worksheet but not the regular users. We are
not able to change the files properties on the network...
Thank you. DG.
Dave Peterson - 17 Mar 2008 14:32 GMT
If you used a commandbutton from the control toolbox toolbar, you can add this
line to the top of your code:

me.unprotect password:="TheRealPasswordHere"
'then your code
me.protect password:="TheRealPasswordHere"

If you used a button from the Forms toolbar, you can use:

Activesheet.unprotect password:="TheRealPasswordHere"
'then your code
Activesheet.protect password:="TheRealPasswordHere"

> Hello,
> I have a protected (real password... not just protection wihout
[quoted text clipped - 4 lines]
> NB : I don't want put the password in the macro, means unprotect and
> protect the worksheet in the macro...

Signature

Dave Peterson

Dave Peterson - 17 Mar 2008 14:33 GMT
Sorry.

I didn't read the note at the bottom.

Ignore my post.

> Hello,
> I have a protected (real password... not just protection wihout
[quoted text clipped - 4 lines]
> NB : I don't want put the password in the macro, means unprotect and
> protect the worksheet in the macro...

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.