No overload for method 'get_Range' takes '1' arguments is error encountered by VB programmers trying to code in C#.
Excel.Workbook oWB = oXL.Workbooks.Open(sXLFileName, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing,missing );
// processing
Excel.Worksheet oWS = (Excel.Worksheet)oWB.Worksheets[1];
oWS.get_Range("A1").Value2 = "No";
This occurs when get_Range method is supplied with only one argument. Instead use any of the following:
oWS.get_Range("A1","A1").Value2 = "No";
or
Object missing = System.Type.Missing;
oWS.get_Range("A1",missing ).Value2 = "No";
Error Dialog
No comments:
Post a Comment