+ Reply to Thread
Results 1 to 4 of 4

Always prompted for Save with function

  1. #1
    GM
    Guest

    Always prompted for Save with function

    I have this function in a module, however if I open the workbook and make no
    changes to it and go to close it I am always prompted to save yes or no. How
    can I fix this?
    Function DocProps(prop As String)
    Application.Volatile
    On Error GoTo err_value
    DocProps = ActiveWorkbook.BuiltinDocumentProperties _
    (prop)
    Exit Function
    err_value:
    DocProps = CVErr(xlErrValue)
    End Function


    TIA
    GM


  2. #2
    Tom Ogilvy
    Guest

    Re: Always prompted for Save with function

    Don't make it Volatile.

    --
    Regards,
    Tom Ogilvy


    "GM" <[email protected]> wrote in message
    news:[email protected]...
    > I have this function in a module, however if I open the workbook and make

    no
    > changes to it and go to close it I am always prompted to save yes or no.

    How
    > can I fix this?
    > Function DocProps(prop As String)
    > Application.Volatile
    > On Error GoTo err_value
    > DocProps = ActiveWorkbook.BuiltinDocumentProperties _
    > (prop)
    > Exit Function
    > err_value:
    > DocProps = CVErr(xlErrValue)
    > End Function
    >
    >
    > TIA
    > GM
    >




  3. #3
    GM
    Guest

    Re: Always prompted for Save with function

    Thanks Tom perfect

    "Tom Ogilvy" wrote:

    > Don't make it Volatile.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "GM" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have this function in a module, however if I open the workbook and make

    > no
    > > changes to it and go to close it I am always prompted to save yes or no.

    > How
    > > can I fix this?
    > > Function DocProps(prop As String)
    > > Application.Volatile
    > > On Error GoTo err_value
    > > DocProps = ActiveWorkbook.BuiltinDocumentProperties _
    > > (prop)
    > > Exit Function
    > > err_value:
    > > DocProps = CVErr(xlErrValue)
    > > End Function
    > >
    > >
    > > TIA
    > > GM
    > >

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: Always prompted for Save with function

    I am not sure it is perfect, because the point of the Volatile is to force
    the function to update. You might need to come up with a cleaver time to
    force a calculatefull - however, you would again have to avoid doing it when
    no changes are made to the workbook.

    Possibly You could do it in the workbook open event, then set

    ThisWorkbook.Saved = True

    at the end of the event.

    Not up on events, see Chip Pearson's site for an overview
    http://www.cpearson.com/excel/events.htm

    --
    Regards,
    Tom Ogilvy

    "GM" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Tom perfect
    >
    > "Tom Ogilvy" wrote:
    >
    > > Don't make it Volatile.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "GM" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I have this function in a module, however if I open the workbook and

    make
    > > no
    > > > changes to it and go to close it I am always prompted to save yes or

    no.
    > > How
    > > > can I fix this?
    > > > Function DocProps(prop As String)
    > > > Application.Volatile
    > > > On Error GoTo err_value
    > > > DocProps = ActiveWorkbook.BuiltinDocumentProperties _
    > > > (prop)
    > > > Exit Function
    > > > err_value:
    > > > DocProps = CVErr(xlErrValue)
    > > > End Function
    > > >
    > > >
    > > > TIA
    > > > GM
    > > >

    > >
    > >
    > >




+ 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