Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to enter password in the program instead of entering everytime
on file open. I need to open several files in which same password is used. How to do in programatically enter a password while file open? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you open all these files at once?
If yes, you could create a new workbook that only serves to open the others (while supplying the password): Option Explicit Sub testme() Dim myFileNames As Variant Dim myPWD as String Dim iCtr As Long 'put all workbook names here myFileNames = Array("C:\my documents\excel\book1.xls", _ "C:\my documents\excel\book2.xls", _ "C:\my documents\excel\book3.xls") myPWD = "TopSeCreTPAssWordHerE!" For iCtr = LBound(myFileNames) To UBound(myFileNames) On Error Resume Next Workbooks.Open Filename:=myFileNames(iCtr), Password:=myPWD If Err.Number < 0 Then MsgBox myFileNames(iCtr) & " didn't open" & vbLf & "Quitting!" Err.Clear Exit Sub End If Next iCtr End Sub Vijay Kotian wrote: I would like to enter password in the program instead of entering everytime on file open. I need to open several files in which same password is used. How to do in programatically enter a password while file open? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can not open the Password file | Excel Discussion (Misc queries) | |||
open ftp file with password | Excel Worksheet Functions | |||
PASSWORD REMOVAL I have the password to open the file and the password to modify the file now how to remove them | Excel Programming | |||
Password to open file | Excel Discussion (Misc queries) | |||
Open file without Password | Excel Programming |