View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Henk Frigge[_2_] Henk Frigge[_2_] is offline
external usenet poster
 
Posts: 9
Default 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