Excel How do I include my password in a macro? :: MrExcel Message Board


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

How do I include my password in a macro?
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

Barry Katcher
Board Master
Board  Master


Joined: 26 Feb 2002
Posts: 1930
Location: Florida. Yeaahh!
Flag: Usa

Status: Offline

 Reply with quote  

I have a workbook that is used by several end-user with sheets that are password protected so they can't overwrite formulas. I have a button which runs a macro that I recorded that unprotects the sheet, performs several other operations, and then protects the sheet again.

The problem is, that when the macro is run by the end-user, it stops and a drop-down box asks for the password to be entered to unprotect. Obviously, it would be defeating the purpose to give the users the password.

My question is: is there any code I can insert in the macro to automatically enter my password in the box to unprotect, and once again, enter it twice to re-protect?

Thanx in advanx.

_________________
Barry-I used to be a werewolf, but I'm much better nowWWWWWWW!

Post Fri Nov 22, 2002 2:02 pm 
 View user's profile Send private message Send e-mail AIM Address

B_2
Board Master


Joined: 25 Aug 2002
Posts: 175


Status: Offline

 Reply with quote  

Sheets(sheet1).Unprotect Password:="B_2"

Sheets(sheet1).Protect Password:="B_2"


Post Fri Nov 22, 2002 2:07 pm 
 View user's profile Send private message

Barry Katcher
Board Master
Board  Master


Joined: 26 Feb 2002
Posts: 1930
Location: Florida. Yeaahh!
Flag: Usa

Status: Offline

 Reply with quote  

Thanks, B_2. The migraine I've had the past 6 months has suddenly cleared up.

_________________
Barry-I used to be a werewolf, but I'm much better nowWWWWWWW!

Post Fri Nov 22, 2002 2:11 pm 
 View user's profile Send private message Send e-mail AIM Address
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.