+ Reply to Thread
Results 1 to 11 of 11

Password protecting a workbook

  1. #1
    Registered User
    Join Date
    09-07-2017
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    35

    Password protecting a workbook

    Please help with syntax error for code below:

    ActiveWorkbook.SaveAs Filename:= ("C:\Users\abek276\Desktop\REPORTS1\, FileFormat:=xlExcel8,Password: ="hell001", WriteResPassword:="", ReadOnlyRecommended:=False, _
    CreateBackup:=False)& MyName

  2. #2
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: Password protecting a workbook

    try

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-07-2017
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    35

    Re: Password protecting a workbook

    thanks but his isn't working.

    how do you add in the password to the Save as bit of code?

  4. #4
    Registered User
    Join Date
    09-07-2017
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    35

    Re: Password protecting a workbook

    thanks but his isn't working.

    how do you add in the password to the Save as bit of code?
    Last edited by AliGW; 02-04-2019 at 02:32 AM.

  5. #5
    Registered User
    Join Date
    09-07-2017
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    35

    Re: Password protecting a workbook

    this is my current code:

    ActiveWorkbook.SaveAs ("C:\Users\abek276\Desktop\REPORTS1\") & MyName

    how do you add in the password to the Save as bit of code?
    Last edited by AliGW; 02-04-2019 at 02:32 AM.

  6. #6
    Registered User
    Join Date
    09-07-2017
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    35

    Re: Password protecting a workbook

    need Urgent assistance anyone?

  7. #7
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Password protecting a workbook

    You had a bracket and the & MyName in the wrong place.

    Try this:
    Please Login or Register  to view this content.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  8. #8
    Registered User
    Join Date
    09-07-2017
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    35

    Re: Password protecting a workbook

    This is perfect.... thanks

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Password protecting a workbook

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.

    need Urgent assistance anyone?
    This is a forum manned by volunteers in their spare time, not a paid 'service' - please don't expect urgent attention. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  10. #10
    Registered User
    Join Date
    09-07-2017
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    35

    Re: Password protecting a workbook

    Noted

    Thanks

  11. #11
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Password protecting a workbook

    You're welcome.
    If that takes care of your original question, then please take a moment to mark the thread as Solved so others know there's an answer here (instructions are in my sig). Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help with password protecting shared workbook
    By damiengajda in forum Excel General
    Replies: 3
    Last Post: 08-09-2018, 03:43 AM
  2. [SOLVED] Password protecting an individual sheet in a workbook
    By Nitro2481 in forum Excel General
    Replies: 17
    Last Post: 10-27-2014, 07:02 AM
  3. VBA Code for password protecting excel workbook
    By learningexcel12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2014, 11:02 AM
  4. Replies: 2
    Last Post: 01-08-2013, 08:31 PM
  5. Password protecting a workbook prevents Macros from working.
    By PeterMcCarthy in forum Excel General
    Replies: 3
    Last Post: 02-07-2012, 07:01 PM
  6. Protecting Workbook w/ password using VBA
    By ste_mulv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2009, 11:33 AM
  7. password protecting sheet when workbook opens
    By mercer77 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2006, 08:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1