Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   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

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/



  #2   Report Post  
Posted to microsoft.public.office.developer.automation,microsoft.public.office.developer.com.add_ins,microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Huge bug of Saved property in Excel2000

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/





  #3   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

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/







  #4   Report Post  
Posted to microsoft.public.office.developer.automation,microsoft.public.office.developer.com.add_ins,microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Huge bug of Saved property in Excel2000

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/








  #5   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

Nick,

I just discovered the following: if my COM add-in is not registered, the
macro test succeeds. If I register my COM add-in, suddenly the Saved
property is no longer working. Even if I do not react to any event, if I do
not change anything on the doucments that get opened/closed. Any idea why?

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/












  #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/










  #7   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

Guys,

Another update. Apparently, after I touch the collection
Workbook.CustomDocumentProperties the Workbook.Saved property is no longer
functioning properly. What the hell is going on?!? This only misbehaves in
Excel 2000.

Any help or explanation is welcome! Thanks.
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/










  #8   Report Post  
Posted to microsoft.public.office.developer.automation,microsoft.public.office.developer.com.add_ins,microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Huge bug of Saved property in Excel2000

I don't write COM add-ins, so I can't answer your question.

NickHK

"LF" wrote in message
...
Guys,

Another update. Apparently, after I touch the collection
Workbook.CustomDocumentProperties the Workbook.Saved property is no longer
functioning properly. What the hell is going on?!? This only misbehaves in
Excel 2000.

Any help or explanation is welcome! Thanks.
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/












  #9   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

Nick,

This is NOT a COM add-in related problem. Try the following macro in Excel
2000 and you'll see the bug:

Sub TestBug()
ActiveWorkbook.CustomDocumentProperties.Add "Another", False, 4, "Test"
ActiveWorkbook.Saved = True
End Sub

To summarize: in Excel 2000, after you alter the
WorkBoox.CustomDocumentProperties collection in any way, the Workbook.Saved
property is no longer working. It stays False, no matter what you do. I
consider this a bug, and a very nasty + important one at that. Anyone at
Microsoft can tell us anything about this? Workarounds? Fixes? I am
desperate.

Best regards,
Levente

"NickHK" wrote in message
...
I don't write COM add-ins, so I can't answer your question.

NickHK

"LF" wrote in message
...
Guys,

Another update. Apparently, after I touch the collection
Workbook.CustomDocumentProperties the Workbook.Saved property is no
longer
functioning properly. What the hell is going on?!? This only misbehaves
in
Excel 2000.

Any help or explanation is welcome! Thanks.
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/














  #10   Report Post  
Posted to microsoft.public.office.developer.automation,microsoft.public.office.developer.com.add_ins,microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Huge bug of Saved property in Excel2000

OK, I see what you mean now.
Yes, .Saved always remains False.
But there are many short comings of the CustomDocumentProperties collection,
that seems somewhat screwy.

But if you do not intend to save that added properties in the WB, use a
hidden name or something else for the data.
Depends why you need to do this.

NickHK

"LF" wrote in message
...
Nick,

This is NOT a COM add-in related problem. Try the following macro in Excel
2000 and you'll see the bug:

Sub TestBug()
ActiveWorkbook.CustomDocumentProperties.Add "Another", False, 4, "Test"
ActiveWorkbook.Saved = True
End Sub

To summarize: in Excel 2000, after you alter the
WorkBoox.CustomDocumentProperties collection in any way, the

Workbook.Saved
property is no longer working. It stays False, no matter what you do. I
consider this a bug, and a very nasty + important one at that. Anyone at
Microsoft can tell us anything about this? Workarounds? Fixes? I am
desperate.

Best regards,
Levente

"NickHK" wrote in message
...
I don't write COM add-ins, so I can't answer your question.

NickHK

"LF" wrote in message
...
Guys,

Another update. Apparently, after I touch the collection
Workbook.CustomDocumentProperties the Workbook.Saved property is no
longer
functioning properly. What the hell is going on?!? This only misbehaves
in
Excel 2000.

Any help or explanation is welcome! Thanks.
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/


















  #11   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

Nick,

Some of the properties I store on the workbook are transitory (only used
while the workbook is open) and some I need to store with the workbook.
These must be invisible to the user. Any suggestion where to store these?

Also, what "many shortcomings" are you talking about? I already know that
only string properties are supported and that each property cannot be larger
than 255 characters. Also, I also know that these custom document properties
are stored in a COM stream in the root storage (we all know that a .xls
document is a compound document, right?) and although COM supports other
types of entries there, Excel only uses string properties.This collection is
also damn slow (cannot make up for the fact that each property is limited in
size and try to store thousands of properties as chunks of what you intend
to store). Moreover, if Excel finds anything in this property collection
that it does not recognize (too long strings, entries of different type than
string) it will simply trash all the properties (I will loose them).
Finally, these properties are visible in File\Properties tab Custom (and
users can remove them - I use GUIDS as property names though, maybe they'll
refrain from deleting those). Anything else?

Regards,
Levente

"NickHK" wrote in message
...
OK, I see what you mean now.
Yes, .Saved always remains False.
But there are many short comings of the CustomDocumentProperties
collection,
that seems somewhat screwy.

But if you do not intend to save that added properties in the WB, use a
hidden name or something else for the data.
Depends why you need to do this.

NickHK

"LF" wrote in message
...
Nick,

This is NOT a COM add-in related problem. Try the following macro in
Excel
2000 and you'll see the bug:

Sub TestBug()
ActiveWorkbook.CustomDocumentProperties.Add "Another", False, 4, "Test"
ActiveWorkbook.Saved = True
End Sub

To summarize: in Excel 2000, after you alter the
WorkBoox.CustomDocumentProperties collection in any way, the

Workbook.Saved
property is no longer working. It stays False, no matter what you do. I
consider this a bug, and a very nasty + important one at that. Anyone at
Microsoft can tell us anything about this? Workarounds? Fixes? I am
desperate.

Best regards,
Levente

"NickHK" wrote in message
...
I don't write COM add-ins, so I can't answer your question.

NickHK

"LF" wrote in message
...
Guys,

Another update. Apparently, after I touch the collection
Workbook.CustomDocumentProperties the Workbook.Saved property is no
longer
functioning properly. What the hell is going on?!? This only
misbehaves
in
Excel 2000.

Any help or explanation is welcome! Thanks.
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/


















  #12   Report Post  
Posted to microsoft.public.office.developer.automation,microsoft.public.office.developer.com.add_ins,microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Huge bug of Saved property in Excel2000

Hi Lf,

Apparently, after I touch the collection
Workbook.CustomDocumentProperties the Workbook.Saved property is no longer
functioning properly. What the hell is going on?!? This only misbehaves in
Excel 2000.

Office 2000, generally, had more problems with VBA than later versions. Call
it growing pains...

In any case, it can generally be a problem with Word and Excel if you make
changes that aren't directly in the "document". If you want to force the
Saved property to be true, either set it explicitly, or write and then delete
(*not* undo) something into an empty cell after "talking to" the Document
Properties.

An alternative to using document properties would be a hidden and protected
worksheet in the workbook. The Excel experts in the excel.programming
newsgroup might have some good suggestions, as well...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
if you've accidentally saved a huge spreadsheet as a web doc... gwenwifar Excel Discussion (Misc queries) 2 May 24th 06 03:07 AM
Last Saved By property [email protected] Excel Programming 2 January 10th 06 11:46 PM
workbook.saved property Jan[_17_] Excel Programming 2 November 22nd 05 05:07 PM
Catch _AfterSave Event & Saved Property Problem ... Joe HM Excel Programming 7 March 17th 05 11:30 AM
'Saved' Property not working Jim Rech Excel Programming 2 August 5th 04 11:39 PM


All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"