Forum Discussion
amitmahapatra
Nov 03, 2020Copper Contributor
VBA code for password to open excel
Can anyone please help with a VBA code that can be used to ask for password when opening a Excel sheet? There can be a y no of sheets in the work book but none can be accessed if password is wrong.. ...
NikolinoDE
Nov 04, 2020Gold Contributor
As already, @mtarler informed you, the combination of password with VBA and Excel with OneDrive for Web is (to put it mildly) not the most suitable.
Protect / Unprotect is a feature is something which is not supported by Onedrive. Currently, the only option is to download and then protect/unprotect and then reupload.
As far as I know, but... what do I know :).
Workbooks that are protected (encrypted with password protection) cannot be viewed in a browser window or opened via Excel Online. And to open workbooks with password protection, we need to download them to the local PC and open them with Excel.
Here is an article for your reference: Workbook features that can differ between the browser and the desktop
Excel worksheet protection in Excel Online
Attached are the instructions for doing it yourself, where no worksheet can be seen, but is only for the entire workbook.
Protect an Excel file - For do-it-yourself
Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel 2019 Excel 2016 Excel 2019 for Mac Excel 2013 Excel 2010 Excel 2007 Excel 2016 for Mac
To prevent others from accessing data in your Excel files, protect your Excel file with a password.
Protect a worksheet
Excel for Microsoft 365 Excel 2019 Excel 2016 Excel 2013 Excel 2010 Excel 2007
That was all I could give you in terms of information.
If you want to use VBA but with changes that you want, please simply give us a message.
If you want to use VBA but with changes that you want, please simply give us a message.
Thank you for your understanding and patience
Wish you a nice day.
Nikolino
I know I don't know anything (Socrates)
- amitmahapatraNov 04, 2020Copper Contributor
NikolinoDE and @mtarler .. thanks so much for all your help and time.