View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Shawn G. Shawn G. is offline
external usenet poster
 
Posts: 35
Default Open workbook with password in VBA


I have saved several workbooks in a directory that are password protected.
Using the following code, How do I tell it to use the password when it opens
the file?
MyPath is the directory path
MyFiles(Fnum) is the workbook name. This is an array of workbook names all
using the same password.

Set mybook = Workbooks.Open(MyPath & MyFiles(Fnum))

Thanks
Shawn G.