View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default getObject and password protected workbook

You have to have the password in your code. But then you protect the VBA
module so people cannot read the pasword in the macro.

"Edward" wrote:

Hi everybody,
I use an Excel file as my database and because of the security reasons I
want to make it protected , I have a second file that is shared among users
and this second file reads some data from the first file
I use
Set appExcelData = GetObject(filePath)
to reference the first file , but when I password protect it , it asks the
users for the password , how can I reference the first file and read its data
with giving the password somehwere in my code?
I know if I use open there is a parameter for password but I don't want to
open the file.
--
Best regards,
Edward