Hi all,
I'm new to VBA coding, but have programmed in VB.NET for years, amongst other languages which are irrelevant to list here.
I currently have been required to "come up with a solution to" opening an excel document with an Microsoft Access Control Panel-like page. (Well that's already done)
The system has been set up by someone prior to myself, and I am tasked to improve some little things in the macros that manipulate the data.
The code that opens the excel document to run a macro contained inside was taken directly from a site I stumbled upon, and I noticed the similarity straight away.
Credit: access-excel . t i p s / run-excel-macro-from-access-vba
The problem is, is that the excel document this access code opens is password protected from editing. So the user has to manually type the password.
I was asked to find a way to enter the password programmatically, so the prompt for password does not popup. So I thought, there most be a way to pass in the password as command line argument when opening the file.
But I cannot find any command line parameters that would do this.
Now, I could write a AutoIt script to enter this password easy as pie, but I think this won't be acceptable as its a bit "screen level", but is an option I will bring up if this turns out to be impossible.
And no, removing the password altogether is not something I have control over.
I also saw, a method... ActiveWorkbook.unprotect(password) which may work? But I haven't tested yet, and it may not even work if the password prompt is already visible.
Bookmarks