+ Reply to Thread
Results 1 to 6 of 6

How to prevent "Changed ... Save?" Message after disabling Shape?

Hybrid View

  1. #1
    JON JON
    Guest

    Re: How to prevent "Changed ... Save?" Message after disabling Shape?

    Sorry I do not fully undestand your question but you have tried this kind of
    code in the thisworkbook module?

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Me.Saved = True
    End Sub

    "Joe HM" <unixverse@yahoo.com> wrote in message
    news:1154692924.938618.247380@s13g2000cwa.googlegroups.com...
    > Hello -
    >
    > I posted this question before but I have narrowed down what the problem
    > is.
    >
    > I have a workbook with a button that I want to disable when it is
    > opened in read-only (just to prevent people from pressing it). So I
    > use
    >
    > If ThisWorkbook.ReadOnly Then
    > ThisWorkbook.Sheets("Sheet1").Shapes(1).ControlFormat.Enabled =
    > False
    >
    > The problem is that this somehow triggers Excel to detect a change and
    > as whether to save the workbook upon closing.
    >
    > I used ThisWorkbook.Saved = True after this but it did not make a
    > difference. I even used the Application.EnableEvents = False/True
    > around it.
    >
    > Any ideas?
    >
    > Thanks,
    > Joe
    >




  2. #2
    Joe HM
    Guest

    Re: How to prevent "Changed ... Save?" Message after disabling Shape?

    Yes ... if I put the Saved = True in _BeforeClose() and it it works
    there but I still want Excel to prompt the user if they made any actual
    changes to the data (even if opened in read-only).

    The problem is that ThisWorkbook.Saved stays true after execution of
    the _Open(). Only right before the _BeforeClose() is called, Excel
    decides to set it to False (thus prompting the "...do you want to save"
    message.

    Thanks,
    Joe


    JON JON wrote:
    > Sorry I do not fully undestand your question but you have tried this kind of
    > code in the thisworkbook module?
    >
    > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    > Me.Saved = True
    > End Sub
    >
    > "Joe HM" <unixverse@yahoo.com> wrote in message
    > news:1154692924.938618.247380@s13g2000cwa.googlegroups.com...
    > > Hello -
    > >
    > > I posted this question before but I have narrowed down what the problem
    > > is.
    > >
    > > I have a workbook with a button that I want to disable when it is
    > > opened in read-only (just to prevent people from pressing it). So I
    > > use
    > >
    > > If ThisWorkbook.ReadOnly Then
    > > ThisWorkbook.Sheets("Sheet1").Shapes(1).ControlFormat.Enabled =
    > > False
    > >
    > > The problem is that this somehow triggers Excel to detect a change and
    > > as whether to save the workbook upon closing.
    > >
    > > I used ThisWorkbook.Saved = True after this but it did not make a
    > > difference. I even used the Application.EnableEvents = False/True
    > > around it.
    > >
    > > Any ideas?
    > >
    > > Thanks,
    > > Joe
    > >



+ 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