I had a VBA debugging problem that i finally solved with difficulty.
Along the way, i wanted to find out what workbook a Range object was referring to, but it seems that Range does not have a Workbook property. So, i wanted to verify that, and ask if there is any way i could have gotten at the name of the workbook that the Range object refers to.
For instance if i have a loop
For Each cell In Range(rngaddr)...
When stopped in debugging, in the immediate window i can try this
?cell.address
$L$6
?cell.worksheet.name
daily
?cell.workbook.name
[Property does not exist!]
My code problem was that cell object was apparently referring to the same cell of a different [open] workbook than i thought it was referring to (same sheet name exists in another open workbook). it took me a while to figure out, though.
If this property does not exist, do you know a way i could find out what workbook a Range object is referring to?
Thanks!
Along the way, i wanted to find out what workbook a Range object was referring to, but it seems that Range does not have a Workbook property. So, i wanted to verify that, and ask if there is any way i could have gotten at the name of the workbook that the Range object refers to.
For instance if i have a loop
For Each cell In Range(rngaddr)...
When stopped in debugging, in the immediate window i can try this
?cell.address
$L$6
?cell.worksheet.name
daily
?cell.workbook.name
[Property does not exist!]
My code problem was that cell object was apparently referring to the same cell of a different [open] workbook than i thought it was referring to (same sheet name exists in another open workbook). it took me a while to figure out, though.
If this property does not exist, do you know a way i could find out what workbook a Range object is referring to?
Thanks!