Question:

How to make the macro insert pasword Automaticly, when you have program the macro to open any protect file ?

by  |  earlier

0 LIKES UnLike

I want to create a macro that open a protected file, but, it need be automatically, without the user need to know that.

 Tags:

   Report

1 ANSWERS


  1. Here is a macro that will unprotect a password protected sheet, allow you to perform a task or tasks, then automatically password protect the sheet again.  Change 'password' to the password for your sheet.

    Open workbook

    Copy this macro to clipboard

    Sub Access_Protected_Sheet()

        ActiveSheet.Unprotect Password:="password"

        'put whatever you want to do here

        ActiveSheet.Protect DrawingObjects:=True, _

        Contents:=True, Scenarios:=True, Password:="password"

    End Sub

    Press ALT + F11

    Insert  >  Module

    Paste the macro to the Module area to the right.

    Close back to Excel

    Go to Tools  >  Macro  >  Macros

    Highlight the macro, if it is not already highlighted.

    Click:  Options

    Select a letter to be used as a keyboard shortcut.

    Close back to Excel.

    To run the macro, press Ctrl + your keyboard shortcut letter.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.