+ Reply to Thread
Results 1 to 3 of 3

Determine whether a wrkbook have been changed since the last save

Hybrid View

  1. #1
    Henk Frigge
    Guest

    Determine whether a wrkbook have been changed since the last save

    I have splitted a very large and complex workbook in three seperate parts. To
    navigate between the different workbooks I created a new workbook with four
    buttons "Open file A", "Open file B", "Open file C" and "Exit" So far I
    managed to ask the user if he wants to save the file he is leaving before
    opening the other. E.g. User opens File A, makes some changes and selects
    File B for opening. A little form asks him if he wants to save the changes he
    made to File A. According to his answer File A is saved or not, and File B is
    opened. So far so good. But now I want the little Save-Yes/No form only to
    appear if he made changes to the File A. How do I determine whether he made
    changes to the file or not?

    Thanks in advance,

    Henk




  2. #2
    Jim Thomlinson
    Guest

    RE: Determine whether a wrkbook have been changed since the last save

    Without seeing any code it is hard to give you any specific code. There is a
    saved property with a workbook which is set to false when a change is made.

    Sub test()
    Dim wbkA As Workbook

    Set wbkA = Workbooks("File A.xls")
    MsgBox wbkA.Saved
    End Sub
    --
    HTH...

    Jim Thomlinson


    "Henk Frigge" wrote:

    > I have splitted a very large and complex workbook in three seperate parts. To
    > navigate between the different workbooks I created a new workbook with four
    > buttons "Open file A", "Open file B", "Open file C" and "Exit" So far I
    > managed to ask the user if he wants to save the file he is leaving before
    > opening the other. E.g. User opens File A, makes some changes and selects
    > File B for opening. A little form asks him if he wants to save the changes he
    > made to File A. According to his answer File A is saved or not, and File B is
    > opened. So far so good. But now I want the little Save-Yes/No form only to
    > appear if he made changes to the File A. How do I determine whether he made
    > changes to the file or not?
    >
    > Thanks in advance,
    >
    > Henk
    >
    >
    >


  3. #3
    Henk Frigge
    Guest

    RE: Determine whether a wrkbook have been changed since the last s

    Jim,

    Thanks for your prompt answer.

    Your code indeed generates the information I am looking for. I would like to
    create something like this :

    Dim bk2 As Workbook
    Set bk2 = Workbooks("Wniq Zyprexa forecast B.xls")

    If bk.Save = True Then
    Workbooks("Wniq Zyprexa forecast B.xls").Close SaveChanges:=False
    Else
    Switch_Module_1.Show
    End If

    This code results in a compile error : Expected function or variable.

    Thanks,

    Henk Frigge



    "Jim Thomlinson" wrote:

    > Without seeing any code it is hard to give you any specific code. There is a
    > saved property with a workbook which is set to false when a change is made.
    >
    > Sub test()
    > Dim wbkA As Workbook
    >
    > Set wbkA = Workbooks("File A.xls")
    > MsgBox wbkA.Saved
    > End Sub
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Henk Frigge" wrote:
    >
    > > I have splitted a very large and complex workbook in three seperate parts. To
    > > navigate between the different workbooks I created a new workbook with four
    > > buttons "Open file A", "Open file B", "Open file C" and "Exit" So far I
    > > managed to ask the user if he wants to save the file he is leaving before
    > > opening the other. E.g. User opens File A, makes some changes and selects
    > > File B for opening. A little form asks him if he wants to save the changes he
    > > made to File A. According to his answer File A is saved or not, and File B is
    > > opened. So far so good. But now I want the little Save-Yes/No form only to
    > > appear if he made changes to the File A. How do I determine whether he made
    > > changes to the file or not?
    > >
    > > Thanks in advance,
    > >
    > > Henk
    > >
    > >
    > >


+ 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