Excel spreadsheet password cracking using VBA

前端 未结 4 817
Happy的楠姐
Happy的楠姐 2021-02-10 01:45

I tried writing a vba password cracker code similar to the code I used to crack Excel sheet\'s password But I am not sure if I am doing correctly or not - when i tried this code

4条回答
  •  攒了一身酷
    2021-02-10 02:31

    It looks like you're trying to unlock a workbook with a password to open it?

    You absolutely should not be using Sendkeys for that. You should only ever use sendkeys as a last resort.

    To avoid conflicts, put your code in another workbook and instead of the sendkeys use:

    Workbooks.Open Filename:="C:\passtest.xls", Password:=password
    

    If the workbook is already open and the workbook is protected or a sheet or chart use:

    [object].Unprotect password
    

    Wherew [object] is a reference to what you are trying to unprotect.

    If you are trying to unlock the vba code, follow the comment by JimmyPena

    Here's a reference for someone using similar code to yours for unlocking the active sheet.

提交回复
热议问题