Windows Phone Developers

Showing posts with label C# Excel Errors. Show all posts
Showing posts with label C# Excel Errors. Show all posts

Friday, January 16, 2009

Non-invocable member 'Microsoft.Office.Interop.Excel._Workbook.Worksheets' cannot be used like a method.

Non-invocable member 'Microsoft.Office.Interop.Excel._Workbook.Worksheets' cannot be used like a method is a common error for a VB programmer working on C# projects. The error is solved when the round brackets are replaced with square ones

Excel.Worksheet oWS = (Excel.Worksheet)oWB.Worksheets(1);

To

Excel.Worksheet oWS = (Excel.Worksheet)oWB.Worksheets[1];


Error Message
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

Cannot implicitly convert type 'object' to 'Microsoft.Office.Interop.Excel.Worksheet'. An explicit conversion exists (are you missing a cast?)

Cannot implicitly convert type 'object' to 'Microsoft.Office.Interop.Excel.Worksheet'. An explicit conversion exists (are you missing a cast?) throws up when there is no Explicit casting - (Excel.Worksheet)

Excel.Worksheet oWS =oWB.Worksheets[1];

To

Excel.Worksheet oWS = (Excel.Worksheet)oWB.Worksheets[1];


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