Excel VBA still prompts for password even after coded the password -
this example of code.
set book = app.workbooks.open(wb.path + "/" + excel_name, , , , "r@w51mt35t")
although have stated password open password protected excel file, stills prompt me input password protected excel file.
just clear, trying open excel file macro of active workbook. have searched through internet , seems no 1 had same problem me.
note: password protected excel file created me using following code below.
wb.saveas wb.path & "\" + thirdtitle + "- testpad", fileformat:=51, password:="r@w51mt35t"
thanks!
i think when saving password protection set 2 level protection both opening , changing. if need following:
set book = app.workbooks.open(wb.path + "/" + excel_name, , , , "r@w51mt35t", "r@w51mt35t")
as next argument responsible next level of protection. of course, check password if both set same.
Comments
Post a Comment