Posts by PaulskinX1

    MODERATOR NOTICE: This topic has also been posted on other sites and may already have an answer elsewhere. Please take this into consideration when answering this question

    VBA - How to run procedure to unprotect excel sheet if there could be 3 different password option
    Dear all, I put together a VBA procedure that does the following: * opens a bunch of excel files (separately not at once) from a specific folder (user…
    www.mrexcel.com


    Dear all,


    I put together a VBA procedure that does the following:


    * opens a bunch of excel files (separately not at once) from a specific folder (user indicates the folder)

    * excel files are password protected so it inputs the password , opens the file , then unprotects a specific sheet (as sheets are also pass protected) and does some changes to the file.


    My problem is that for the changes to be applied to each excel file the sheet has to be unprotected and there is unfortunately 3 different options for pass (dont ask me why). I know the pass options so i put it in my code as per snippet attachment to this thread.


    However the procedure still stops if the first pass option is incorrect and I have to manually drag the execution line to the next valid pass for the procedure to continue.


    Essentially my questions are:

    * is the code set up above ok and

    * is there a way of making VBA to attempt another password to unprotect sheet if the first pass is not the correct one (and a third attempt if the 2nd pass is also incorrect)?


    Uff, hope the above makes sense

    Hi Dear all,




    I have excel workbook (with vba procedures in it) with 3 tabs - lets call it Control model.


    Each of the tab in Control model have formulas that are linked to the various sheet names that are not present in the Control model but are on other excel output (Input data -which has 7 sheets). The formulas in 3 tabs of Control model are holding sheet names of those present in Input data.




    My Control model creates output (new excel book) that inserts 3 tabs from control model (with formulas referencing to sheet names of Input data) and Input data file. So I have a final file with 10 sheets in it ,however my formulas in 3 tabs from Control model will not update until I actually go to a specific cell and click after last element of formula and press enter.




    Is there a way of fixing it with VBA or it is just inner excel characteristic that formula will not work if it reference to data that is not present in the same workbook at the time of formula creation?