I have an addin that has range names that are used in code that is called from another open workbook. Most of the range names refer to a single cell and I successfully use the value of those cells with the following code:
the first three variables are public variables declared as strings. The fourth is a public variable declared as a Range, and it doesn't work. I get an error "Object variable of with block variable not set" on the fourth line about. There are no with blocks involved.
Can someone explain why this is not working?
Thanks
Ken
pool_fringe = Awb.Names("pool_fringe").RefersToRange.value
pool_ga = Awb.Names("pool_ga").RefersToRange.value
pool_overhead = Awb.Names("pool_overhead").RefersToRange.value
db_mat_accounts = Awb.Names("db_mat_accounts").RefersToRange
the first three variables are public variables declared as strings. The fourth is a public variable declared as a Range, and it doesn't work. I get an error "Object variable of with block variable not set" on the fourth line about. There are no with blocks involved.
Can someone explain why this is not working?
Thanks
Ken