ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unprotect a workbook while opening from Access (https://www.excelbanter.com/excel-programming/396217-unprotect-workbook-while-opening-access.html)

scottydel

Unprotect a workbook while opening from Access
 
Hi,

(This may be a better fit in an Access Forum, but I'll try here too)

I'm usig Access/Excel 2003. From within an Access application, I create an
Excel file, assign a password to the workbook, save it, and close it. Then,
still in the Access application, the user (who I will call an Admin User) can
open the Excel file by clicking a button. In my world, the Admin User is
responsible for creating the Excel file, and is the "owner" of the data, and
has no reason to be protected from viewing the workbook (the protection is
not with the Admin User in mind). When that button to open the Excel file is
clicked, is there a way to programmatically open the Excel file, from within
Access (for the Admin User), and use the existing password in VBA so the
Admin does not have to type it? Here isthe code that opens the Excel file
currently:

Application.FollowHyperlink "SomeFile.xls", , True, False

There are no arguments on FollowHyperlink that could be used as a password
that I know of. Any other suggestions?

The Excel file gets distributed to a Normal User downstream, and Normal
Users do not open the Excel files from within Access. Normal Users open the
Excel file normally (double-clicking say), and they will and should be
prompted for the workbook password.

So I'm looking for a solution that will allow one user to open an Excel file
and programmatically use the workbook password from within Access (so he is
not prompted for the password), and other users to be prompted when opening
the workbook normally (this piece currently works).

Any ideasd?

Thanks,

-Scott



All times are GMT +1. The time now is 10:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com