Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default how do you open a file read-only?

Being pretty new to macro writing, my standard approach to everything is
to record bits and pieces of what I want to do in mini-macros and then
use that code to build up a more general one.

When I record a macro while opening a file read-only, nothing gets
captured that indicated it's read-only. Furthermore, if I execute the
macro it opens the file as writable.

Does this mean you can't write a macro to open a file read-only OR is
there a bug in excel in that it's not capturing that fact in 'record macro'?

-mark

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how do you open a file read-only?


Good afternoon Mark

Try this

Workbooks.Open Filename:= "C:\TestFile.xls", ReadOnly:=True

The ReadOnly function does seem to be documented, but not to a great
extent. But it works.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=376533

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
FILE CAN ONLY OPEN AS READ ONLY vcff Excel Discussion (Misc queries) 2 November 18th 08 11:18 AM
Help with Open and Read txt file, please? Ed Excel Programming 1 April 28th 05 06:12 AM
How to Open file as read only Helen Excel Programming 1 January 24th 05 02:45 PM
Open File Read Only Chris Excel Programming 1 September 23rd 04 12:11 AM
File in use open read only jeffP Excel Programming 0 August 21st 04 06:37 PM


All times are GMT +1. The time now is 07:05 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"