Windows Phone Developers

Friday, January 16, 2009

No overload for method 'get_Range' takes '1' arguments

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
Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment