Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have code that opens the file and activates it:
Workbooks.Open(FileDir & FilesInPath).Activate But I want to combine this with arguments that will open the file as read only: Workbooks.Open(FileDir & FilesInPath).Activate , ReadOnly:=True, _ Password:="Metrics" This line gives me an error "invalid number of arguments". Is it possible to open as active as read-only? Thanks - -- Regards, John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Set NewBk = Workbooks.Open(FileDir & FilesInPath , ReadOnly:=True, _ Password:="Metrics") NewBk.Activate It is not recommended to use SELECT or ACTIVATE method it slows down the code and switches sheets when it is not necessary. It is better to refer to the book by its set name "John Brenner" wrote: I have code that opens the file and activates it: Workbooks.Open(FileDir & FilesInPath).Activate But I want to combine this with arguments that will open the file as read only: Workbooks.Open(FileDir & FilesInPath).Activate , ReadOnly:=True, _ Password:="Metrics" This line gives me an error "invalid number of arguments". Is it possible to open as active as read-only? Thanks - -- Regards, John |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'll try that, Joel.
Much obliged. -- Regards, John "Joel" wrote: Set NewBk = Workbooks.Open(FileDir & FilesInPath , ReadOnly:=True, _ Password:="Metrics") NewBk.Activate It is not recommended to use SELECT or ACTIVATE method it slows down the code and switches sheets when it is not necessary. It is better to refer to the book by its set name "John Brenner" wrote: I have code that opens the file and activates it: Workbooks.Open(FileDir & FilesInPath).Activate But I want to combine this with arguments that will open the file as read only: Workbooks.Open(FileDir & FilesInPath).Activate , ReadOnly:=True, _ Password:="Metrics" This line gives me an error "invalid number of arguments". Is it possible to open as active as read-only? Thanks - -- Regards, John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to Activate "Show all" in a Protected Shared Workbook | Excel Discussion (Misc queries) | |||
Excel files opening in "read only" | Excel Discussion (Misc queries) | |||
Activate "current workbook" | Excel Programming | |||
Checking before opening "activate:newwindow" to see if already opened | Excel Programming | |||
"Unable to Read File" on workbook containing Pivot Table | Excel Programming |