View Single Post
  #6   Report Post  
Posted to microsoft.public.office.developer.automation,microsoft.public.office.developer.com.add_ins,microsoft.public.excel.programming
LF LF is offline
external usenet poster
 
Posts: 32
Default Huge bug of Saved property in Excel2000

Actually,

My previous findings are incomplete. If I catch no events (or return S_OK
from all of them), then the Saved property works OK. If, however, I catch
OnNewDocument and add a custom property to the document, then I set the
Saved flag to true (this is part of my appliation's processing, it works in
all other Office apps, also in all other Excels excelp 2000) then the Saved
property no longer functions properly. I do not understand. Any help?

Regards,
Levente


"NickHK" wrote in message
...
Excel2000, English, W2K:
Using code below, there is no Excel prompt about saving the changes.
Comment
out the .Saved line and the prompt appears. So .Saved is working for me.

Private Sub CommandButton1_Click()
Range("A1") = ""
Range("A1") = "New Text"

With ThisWorkbook
.Saved = True
.Close
End With

End Sub

NickHK

"LF" wrote in message
...
Nick,

What is the version + build number of your Excel 200? What language is

your
Excel 2000? What OS are you trying on? How are you trying to determine

that
the Workbook.Saved property is working OK? Did you try my example
using/debugging a macro?

Thanks,
Levente

"NickHK" wrote in message
...
XL2000 with all service packs applied:
I see .Saved property responding correctly.

NickHK

"LF" wrote in message
...
Dennis,

Thanks for confirming this mess. I just found out that the same
problem
is
also present in PowerPoint 2000, but it got resolved with some service
pack.
Why is this not solved in Excel 2000 too? I am disperate for a

solution,
can
anyone please help?!?

Regards,
Levente


"XL-Dennis" wrote in message
...
Levente,

I'm running Swedish version of Excel 2000 with SP-3 installed on a
Windows
XP platform (Unfortunately I have only access to English version of
2002,
2003, 2007 but not for 2000).

I have done the following two tests:

Option Explicit

Sub test()
Dim wbBook As Excel.Workbook
Set wbBook = ActiveWorkbook
wbBook.Saved = True
'The following line gives 'True'
MsgBox wbBook.Saved, vbOKOnly, "Status 1"
wbBook.Saved = False
'The following line gives 'False'
MsgBox wbBook.Saved, vbOKOnly, "Status 2" '
End Sub

Sub Test2()
Dim wbBook As Excel.Workbook
Set wbBook = ActiveWorkbook
wbBook.Saved = False
'This gives 'False'
MsgBox wbBook.Saved, vbOKOnly, "Status 1"
'This gives also 'False'
'The same output is achieved when setting it to True, i e it gives

the
same
msg.
MsgBox wbBook.Saved, vbOKOnly, "Status 2"
End Sub

In general I would advise to avoid the use of 'ActiveWorkbook' as it
can
refer to the wrong workbook.

I must admit I'm confused why You have this issue...
I've made some online searches and noticed that the issue have been
discussed several times but no solution is given in any of the
cases.

It would be great if someone from MSFT could comment it but I'm not
sure
if
they still support 2000 or not.

---------------
With kind regards,
Dennis
Weekly Blog .NET & Excel: http://xldennis.wordpress.com/
My English site: http://www.excelkb.com/default.aspx
My Swedish site: http://www.xldennis.com/