Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
KNg KNg is offline
external usenet poster
 
Posts: 1
Default Default to Read Only

Hi,

Please shed me light on the macro syntax to default the OpenFile option to
'Read Only' when a dialog box is prompted for password-protected file.

Thanks,
Kenny.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Default to Read Only

Kenny

avoid the FileFind Dialog: you'll have no control

use GetOpenFileName to get the user to tell you which file he wants.
then have your code do it with all the verifications etc that you want..
in this case few.. just the Readonly


Sub OpenRO()
Dim vFile As Variant
vFile = Application.GetOpenFilename("Excel Files,*.xls")
If vFile = False Then
Beep
Else
Workbooks.Open vFile, ReadOnly:=True
End If

End Sub


see VBA help for the methods..


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


KNg wrote :

Hi,

Please shed me light on the macro syntax to default the OpenFile
option to 'Read Only' when a dialog box is prompted for
password-protected file.

Thanks,
Kenny.

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
Default Windows Profile without default Office user info Karen Excel Discussion (Misc queries) 0 November 12th 08 04:53 PM
I have a read only xl file, I need it to be read and write drama queen Excel Discussion (Misc queries) 3 July 1st 06 12:25 AM
How can a file be converted from Read-Only to Read/Write Jim in Apopka Excel Discussion (Misc queries) 2 November 19th 05 04:59 PM
How to set Read-Only Recommended as default save in Excel 2002? flyaj Excel Discussion (Misc queries) 1 April 14th 05 11:04 PM
read-only default scottwilsonx[_56_] Excel Programming 0 October 19th 04 10:29 AM


All times are GMT +1. The time now is 12:16 PM.

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

About Us

"It's about Microsoft Excel"