Hi,
A.xls has a Obj1.cls class.
B.xls want to set the Obj1.
How can I do that?
in B.xls
is it, Dim ObjectA as application.workbooks("A.xls").Obj1?
Hi,
A.xls has a Obj1.cls class.
B.xls want to set the Obj1.
How can I do that?
in B.xls
is it, Dim ObjectA as application.workbooks("A.xls").Obj1?
I'm afraid this cant be done in excel vba.
it's got class but it aint royalty.
You can do this if you have added a reference to workbook A in workbook B.
The first thing to do is to select the VBAProject for Workbook A and give it a name other than the default. (Use the Properties dialog.) If not, when you attempt to create the reference you will get an "ambiguous" warning.
Next, in the VBE select workbook B and go to Tools >> References and click "on" the name you just gave to the VBProject for Workbook A (I named mine "test2".
Now, I assume that in Workbook A you have a public declaration statement somewhere that created an obj1 object. If so, then in Workbook B as you begin to type:
Set cl = test2.
you will see the object of your desires in the listing of test2 objects available for reference.
Hope this helps. By the way, thahks for the question. I would have never thought to do this!
- Pete
gabch - are you trying to access the methods and propoerties of the class module from the closed workbook A?
if so, I'm still not convinced you'll be able to reference, instantiate and call them.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks