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
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.