+ Reply to Thread
Results 1 to 3 of 3

Passworded needed to run Saved VBA code

Hybrid View

  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    thailand
    MS-Off Ver
    Excel 2003
    Posts
    25

    Passworded needed to run Saved VBA code

    I added a new macro to an existing sheet (A) which is protected by a password. I then save the existing sheet (A) under a new name (B) and when I try to use the new macro, it asked me for the password to the old existing sheet (A).

    How do i make sure that subsequent saved sheet under a new name created from the existing sheet (A) does not require any password to run the new macro. Thank you

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Passworded needed to run Saved VBA code

    Hi, outlook888,

    from what I understand from your post (not really get why code must be protected only in one workbook, I would have expected it just to be the other way):
    If ThisWorkbook.Name = "EF918592.xlsm" Then
      MsgBox "Here we go for the password"
      'password protection
    End If
    'run code
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    03-28-2013
    Location
    thailand
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Passworded needed to run Saved VBA code

    thank you. I had a look at my codes and realised that they are linked to another sheet which is protected.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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