Hi there,
I'm trying to read the ActiveCell from within an Excel Add-in but not getting very far. Anyone any ideas?
Excel.Window W = this.Application.ActiveWindow as Excel.Window;
Excel.Range R = W.ActiveCell as Excel.Range;
MessageBox.Show(R.Value2.ToString());
The Exception being thrown on the last line is: -
Cannot obtain fields or call methods on the instance of type 'Microsoft.Office.Interop.Excel.Range' because it is a proxy to a remote object.
I tried .Value, and it says: -
Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop.Excel.Range.get_Value(object)' or 'Microsoft.Office.Interop.Excel.Range.set_Value(object, object)'
On trying get_Value() I get the initial Exception again.
Cannot obtain fields or call methods on the instance of type 'Microsoft.Office.Interop.Excel.Range' because it is a proxy to a remote object.
Any ideas?
Cheers,
Phil.