TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gomathi Palaniswamy
NA
3.5k
2.2m
Unable to cast COM object of type 'Excel.WorksheetClass' to interface type 'Excel._Worksheet'. This ...
Dec 12 2011 4:48 AM
objExcel = new Excel.Application();
Excel.Worksheet tmpWorksheet = new Excel.Worksheet();
objExcel.Visible = true;
objWorkBook = objExcel.Workbooks.Open(strExcelFile, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true,false,false);
string[] strSheetName = new string[objWorkBook.Worksheets.Count-1];
int i = 0;
foreach (Excel.Worksheet tmpWorkSheet in objWorkBook.Worksheets)
{
strSheetName[i] = tmpWorksheet.Name;//
error occurs here
i += 1;
}
objExcel.Quit();
the above coding sholwing the error below error
"Unable to cast COM object of type 'Excel.WorksheetClass' to interface type 'Excel._Worksheet'. This operation failed because the QueryInterface call on the COM component for the interface with IID "
help me pls.
Reply
Answers (
2
)
Fluent NHibernate
Setup program