Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[b]Application.FollowHyperlink Password dilemma [/b] 1

Status
Not open for further replies.

trystanhuwwilliams1

Programmer
Jan 7, 2003
44
0
0
GB
Hi,

Don't know if this is possible, but here goes..
I want to open password protected Excel Workbooks from
an Access Form via the code below.
Code:
strPath = "Dir\Path" & "\" & rs("file").Value
Application.FollowHyperlink strPath, , True, False

This works except that it won't allow a password to be entered in the code. Does anyone know is this can be done?


Also, I found a strange phenomenon which occurred whilst I was experimenting in this area. When I added the Microsoft Excel 9.0 Object Library to the VBA Access references, and then used the following code:

Code:
Workbooks.Open (strPath), , , , "password"

I found that this opened the Workbook virtually. I could access data using cell references etc without being able to physically see the workbook.

Could be useful to someone, I don't know.

Regards,

Trystan
 
myXL.Workbooks.Open (strPath), , , , "password"
myXL.Visible = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Set myXL = CreateObject("Excel.Application")
myXL.Workbooks.Open strPath, , , , "password"
myXL.Visible = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top