Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Change Read-Only Recommended Prompt

' *.xls' should be opened as read only unless you need to save changes.
Open as read-only?
Yes No Cancel

Is there code to disable the cancel option when this prompt comes up?

OR

Can I make something else happen when cancel is selected instead of
whatever excel tells it to do? Overriding the cancel button would be
fine as well.

I am opening a workbook with a commandbutton on a form in another
workbook. I want to give users the option of opening the workbook as
readonly or not, but if the cancel button is selected, it is not
returning to the form I need it to go to. I have tried making my own
msgbox with only a yes and no button, it just seems dimming the cancel
button would more simple if I knew where to start.

Any ideas?

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Change Read-Only Recommended Prompt

If you want to give the user the option to open readonly, I would probably
use the msgbox you mentioned w/yes and no buttons

Sub test()
Const WkBkPath = "H:\Book3.xls"
Dim Result As Boolean

If MsgBox("Open Read Only?", vbYesNo) = vbYes Then
Result = True
Else: Result = False
End If
Workbooks.Open Filename:=WkBkPath, ReadOnly:=Result, _
IgnoreReadOnlyRecommended:=True

End Sub

"brookly" wrote:

' *.xls' should be opened as read only unless you need to save changes.
Open as read-only?
Yes No Cancel

Is there code to disable the cancel option when this prompt comes up?

OR

Can I make something else happen when cancel is selected instead of
whatever excel tells it to do? Overriding the cancel button would be
fine as well.

I am opening a workbook with a commandbutton on a form in another
workbook. I want to give users the option of opening the workbook as
readonly or not, but if the cancel button is selected, it is not
returning to the form I need it to go to. I have tried making my own
msgbox with only a yes and no button, it just seems dimming the cancel
button would more simple if I knew where to start.

Any ideas?

Thanks!


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
Read-Only Recommended adlerdm Excel Discussion (Misc queries) 1 May 17th 10 06:40 PM
Articles recommended to read, where can they be found? Ron Excel Worksheet Functions 2 May 17th 05 11:18 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
Recommended Read-Only Property Tim Childs Excel Programming 2 September 24th 04 10:54 PM
cancelling out of read-only recommended locks up Excel 2000 Eric Bragas Excel Programming 0 August 26th 04 03:04 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"