Re: Weird PropertyBag problem, values won't change

Tech-Archive recommends: Fix windows errors by optimizing your registry



Okay, I came across something very discouraging:

---------------------------------------------------
Option Explicit

Public pBag As New PropertyBag

Public Sub Main()
pBag.WriteProperty "Username", "John"
Debug.Print pBag.ReadProperty("Username")
pBag.WriteProperty "Username", "Tony"
Debug.Print pBag.ReadProperty("Username")
pBag.WriteProperty "Username", "Mitch"
Debug.Print pBag.ReadProperty("Username")
End Sub
---------------------------------------------------

To which the debug window displays:

---------------------------------------------------
John
John
John
---------------------------------------------------

It seems as if the PropertyBag object holds on to the values once
they're written. They simply can't be changed. I suppose I'm going to
have to implement my own storage class.

.