98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Adding Passwords to VBA
Adding Passwords to VBA
Resolved · Low Priority · Version 2013
Rebecca has attended:
Excel VBA Introduction course
Excel Pivot Tables course
Adding Passwords to VBA
Hello. I have a macro at the moment which looks at a report which includes a list of trades done for the previous day. The macro looks at each bank the trades have been done with and creates a new workbook for each bank. I then need to create individual passwords for each workbook. Looking online I couldn't find a way to do this via macro so at the moment I have amended my macro so once the workbooks have been created they are left open on my screen then I am adding each password one by one to each workbook. Do you know a way I can get the macro to add a password to each workbook? Thanks
RE: Adding Passwords to VBA
Hi Rebecca,
Thank you for the forum question and thank you for the nice feedback.
The code below will save a workbook with the name FilePath.xlsx and add the password "mypassword" to open the workbook, but you want of course to save the workbooks with different names and passwords. It can be done with a loop and you will also need variables.
Do you name the workbooks the name of the bank and a date??
Which passwords would you like to use for the workbooks??
ActiveWorkbook.SaveAs Filename:="FilePath", Password:="mypassword"
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Display Formulas Instead of Results in Excel 2010By pressing Ctrl ~ once, Excel will display formulas rather than the results of the formulas. Press it again, and the results will appear again. |