I cannot reproduce this, but let me tell you what I did, and maybe this will help you find your problem.
Here is the code for Class1:
Public Function f() As Class2 Set f = New Class2 fp = 42 End Function
and here is the code for Class2:
Private p_ Public Property Let p(value) p_ = value End Property Public Property Get p() p = p_ End Property Private Sub Class_Initialize() Debug.Print "Class 2 init" End Sub Private Sub Class_Terminate() Debug.Print "Class 2 term" End Sub
If I go to the nearest window and enter:
set c1=new Class1
and then
?c1.f().p
I'm coming back:
Class 2 init 42 Class 2 term
So, an instance of class 2 is created, its property “p” is written and read, but then VBA kills it after this line is executed, because no variable has a reference to this instance.
As I said, this does not match your problem as described. I probably lack details in the details, but I hope this helps.
EDIT:
To clarify, I mean for my simpler example calling 'c1.f (). P' to match your
quantityOnHand = Macola.Item("12345").Location("A1").QuantityOnHand
but my simple example works just fine. So now you have three answers that “need more information,” but this is an interesting little puzzle.
If you don’t see an instance of “ItemLocation” at all, does that mean you also don’t see a call to your “Location” method of the “ItemMaster” class? Therefore, the problem may be related to the hosted Location code.