Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default How do I select "Read Only"

I am writing a macro that needs to open another file that is password
protected in "Read Only", copy a sheet into my current file and close the
file I am copying from. How do I write the string to select "Read Only" from
the password window?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default How do I select "Read Only"

Workbooks.Open Filename:="C\Text.xls", ReadOnly:=True, _ Password:="MyPassword"
--
HTH...

Jim Thomlinson


"iashorty" wrote:

I am writing a macro that needs to open another file that is password
protected in "Read Only", copy a sheet into my current file and close the
file I am copying from. How do I write the string to select "Read Only" from
the password window?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default How do I select "Read Only"

If you want to open the file in read-only mode, ReadOnly is one of the
options for the Workbooks.Open method:

Workbooks.Open Filename:="D:\Data\book1.xls", _
Password:="abc", ReadOnly:=True

If you meant that the workbook was save with the read-only recommnded
option, you can tell Excel not to display the read-only recommended message:

Workbooks.Open Filename:="D:\Data\book1.xls", _
Password:="abc", IgnoreReadOnlyRecommended:=True

Hope this helps,

Hutch

"iashorty" wrote:

I am writing a macro that needs to open another file that is password
protected in "Read Only", copy a sheet into my current file and close the
file I am copying from. How do I write the string to select "Read Only" from
the password window?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default How do I select "Read Only"

Thanks Jim. It worked beautifully.

"Jim Thomlinson" wrote:

Workbooks.Open Filename:="C\Text.xls", ReadOnly:=True, _ Password:="MyPassword"
--
HTH...

Jim Thomlinson


"iashorty" wrote:

I am writing a macro that needs to open another file that is password
protected in "Read Only", copy a sheet into my current file and close the
file I am copying from. How do I write the string to select "Read Only" from
the password window?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default How do I select "Read Only"

Thanks, Tom. Indeed it was the first item.


"Tom Hutchins" wrote:

If you want to open the file in read-only mode, ReadOnly is one of the
options for the Workbooks.Open method:

Workbooks.Open Filename:="D:\Data\book1.xls", _
Password:="abc", ReadOnly:=True

If you meant that the workbook was save with the read-only recommnded
option, you can tell Excel not to display the read-only recommended message:

Workbooks.Open Filename:="D:\Data\book1.xls", _
Password:="abc", IgnoreReadOnlyRecommended:=True

Hope this helps,

Hutch

"iashorty" wrote:

I am writing a macro that needs to open another file that is password
protected in "Read Only", copy a sheet into my current file and close the
file I am copying from. How do I write the string to select "Read Only" from
the password window?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert numbers to date: "586" to read "May 1986" CEckels Excel Worksheet Functions 5 May 14th 09 04:46 PM
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running [email protected] Excel Programming 5 May 16th 07 08:18 PM
Solution "Your changes could not be saved" "The document may be read-only or encrypted" [email protected] Excel Discussion (Misc queries) 0 August 7th 06 06:31 AM
Using "Cells" to write "Range("A:A,H:H").Select" Trip Ives[_2_] Excel Programming 3 June 5th 04 03:13 PM
The instruction at "0x65255ac9" referenced memory at "0x00000008". The memory could not be read. Clikc OK to terminate etc Angus Comber[_2_] Excel Programming 1 November 7th 03 01:18 PM


All times are GMT +1. The time now is 03:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"