I\'m using C# to manipulate an Excel worksheet. The following two pieces of code should work the same, but one works and the other throws an exception. I wonder why.
For everyone who have this problem, much better use explicit conversion, rather than create new variables.
oRange = (Excel.Range)oSheet.get_Range((Excel.Range)oSheet.Cells[1, 1], (Excel.Range)oSheet.Cells[4,4]);