This line:
Set wksA = gwbB.Names("aName").RefersToRange.Parent
produces the 1004 Application or object defined error in my program, and I can`t figure out why. The statement resides in an addin and tries to set a reference to a sheet (in another project) with a range referred to by the name aName.
wksA is local to the sub in which the error occurs. wksA is declared as
Dim wksA as Worksheet
Debug.print gwkbB.Name shows me the name of the project is correct and the project certainly has the name aName in it and it refers to a range ok.
Could it be that one needs to set a reference to some special object library to do this?
Any help is much appreciated.
Bookmarks