I am simply attempting to set the value of a cell using a function I've written in visual basic. Reading values from the cell all work correctly (second image below) but setting the Value property continually throws an <Out of Context> error in the watch window. I've not had this problem previously in code I've written in earlier versions of Excel and am stumped.
In the first image the code is being called in cell B63 and is attempting to reset the value of cell B60.
In the second image the code has been called and you can see the values of the local variables in the Locals window along with the value of the B60 cell in the Watches window.
In the third image I've stepped through the line that should set the value of Cell B60 to 2 and receive the <Out of Context> error.
Any help would be appreciated.
In the first image the code is being called in cell B63 and is attempting to reset the value of cell B60.
In the second image the code has been called and you can see the values of the local variables in the Locals window along with the value of the B60 cell in the Watches window.
In the third image I've stepped through the line that should set the value of Cell B60 to 2 and receive the <Out of Context> error.
Any help would be appreciated.