View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Accessing classes defined in another workbook

Thanks Jamie,

"onedaywhen" wrote in message
oups.com...
Bob Phillips wrote:
If the class's Instancing property is changed to PublicNotCreatable
then it is known and can be declared as the class type e.g.

Dim myClass As VBAProject.clsClass1


I knew that I should have been able to, and was sure that I had, but I had
forgotten how, so I went safe :-). The joy of the NGs.

In fact, I think the class in your example must already be
PublicNotCreatable, otherwise I think you would have to declare the
return type of your CreateClass1 function as Object.


I don't think so. That function is in the same workbook as the class, and so
knows about the class implicitly. I juts tested again with the Instancing
property set to Private and it works fine.



BTW, why have you reverted to OneDayWhen?