+ Reply to Thread
Results 1 to 2 of 2

Change Read-Only Recommended Prompt

  1. #1
    brookly
    Guest

    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. #2
    JMB
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1