Community
    • Login

    Search string to replace sheet protection multiple .xml files.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 690 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ken McQuestonK Offline
      Ken McQueston
      last edited by PeterJones

      I have an Excel file that has sheet protection on multiple (400+) excel worksheets in an Excel spreadsheet and I don’t know the password. In order edit the file content I have to remove the sheet protection. I need to remove the following text string from each file: <sheetProtection algorithmName="SHA-512" hashValue="*" saltValue="*" spinCount="100000" sheet="1" objects="1" scenarios="1"/>. Each file has basically the same text string except for the hash value (shown as a * above) and the salt value (shown as an “*” above). Is there a way to search for and replace the string in all 400+ all of the files?

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Online
        PeterJones @Ken McQueston
        last edited by

        @Ken-McQueston ,

        Making sure that the Find-in-Files is set to Regular Expression, then you can FIND = <sheetProtection algorithmName="SHA-512" hashValue=".*?" saltValue=".*?" spinCount="100000" sheet="1" objects="1" scenarios="1"/> and replace with the empty string.

        .*? in regular expression mode means “zero or more characters, but don’t be greedy”, which should do what you want in both the hashValue and saltValue fields

        Whenever doing find-in-files search/replace, make sure you have a backup in case something goes wrong.

        (Also note that by breaking sheet protection without the password, you might be violating a user license or privacy agreement; do not follow these instructions to get around legal restrictions; only use it in case you have a private spreadsheet where you forgot your own password, and you have 100% legal right to be breaking that copy protection.)

        Ken McQuestonK 1 Reply Last reply Reply Quote 2
        • Ken McQuestonK Offline
          Ken McQueston @PeterJones
          last edited by

          @PeterJones

          That worked! Thanks for your help!

          Ken

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors