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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Requesting Password from 3rd file

Status
Not open for further replies.
Apr 27, 2006
126
GB
Hi,

Just curious, I am running a report (in excel) which pulls data from an excel sheet (FILE 1) which I am opening and closing within the vb code. But (FILE 1) pulls data from another excel sheet (FILE 2) with linked data, so (FILE 2) is never actually opened. (FILE 2) has a password on it, I know the password, but is there a way (other than using sendkeys) to automatically enter this password without it being a headache every time this report runs?

Hope that makes sense, I have a bad headache and have been staring at code all day

clueless
 
Why not opening FILE 2 by code with the password before opening FILE 1 ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i thougth about that.. but as the initial file is opening 5 excel files and pulling data off them, opening another 5 corresponding files (over a rather crappy network) would just make it take a week each time i ran it... was hoping there was a way to skip it..

i think i might ust give up, remove the passwords on the files and restrict access to the folder that contains them.. not ideal but probably the easiest option :)

clueless
 
Anyway, FILE 2 is perhaps not opened but probably read ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
it isnt opened, and it is read. Which takes me to the original query as to an alternative to sendkeys, or opening the file itelf, to bypass that password.

I've implemented what I said and removed the passwords and protected the folders containing them, but it would still be nice (possibly for future reference) if anyone has any ideas to workaround this?

Thanks for the suggestions though PHV :)

clueless
 
If you want a password, why not use the workbook protect in the excel tools menu? If you're worried about being hacked, you're using the wrong application.

-----------
Regards,
Zack Barresse
 
erm, I don't think you've understood/read what I was trying to do.

regardless, it's not a worry of being hacked, just restricting managers access as they often go in and change stuff when they dont understand what they are doing, causing more problems for me.

________
clueless
 
I thought I understood what you were saying, sounds like what I understood anyway. I still recommend either a sheet password or workbook password; it's much easier to manipulate via VBA than the SaveAs/Tools/Password.

If this is the case, you can record a macro of protecting/unprotecting the workbook and see the proper syntax for the operation.

-----------
Regards,
Zack Barresse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top