Click here to Skip to main content
15,892,809 members
Home / Discussions / C#
   

C#

 
GeneralRe: Form flickering problem Pin
SimpleData16-Oct-09 23:19
SimpleData16-Oct-09 23:19 
GeneralRe: Form flickering problem Pin
Luc Pattyn17-Oct-09 2:18
sitebuilderLuc Pattyn17-Oct-09 2:18 
GeneralRe: Form flickering problem Pin
Lyon Sun17-Oct-09 4:14
Lyon Sun17-Oct-09 4:14 
GeneralRe: Form flickering problem Pin
Luc Pattyn17-Oct-09 4:18
sitebuilderLuc Pattyn17-Oct-09 4:18 
GeneralRe: Form flickering problem Pin
Lyon Sun17-Oct-09 8:09
Lyon Sun17-Oct-09 8:09 
GeneralRe: Form flickering problem Pin
Luc Pattyn17-Oct-09 8:35
sitebuilderLuc Pattyn17-Oct-09 8:35 
GeneralRe: Form flickering problem Pin
Lyon Sun17-Oct-09 10:27
Lyon Sun17-Oct-09 10:27 
QuestionFill Collection With Excel Sheet Column Names Pin
Kevin Marois16-Oct-09 7:14
professionalKevin Marois16-Oct-09 7:14 
I am trying to fill a collection with the names of the colums from an Excel sheet. The inner foreach fails with
"Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.DataColumn'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface."

What am I doing wrong here?

List<string> colColumns = new List<string>();
ApplicationClass ExcelApp = new ApplicationClass();

Workbook WorkBook = ExcelApp.Workbooks.Open(Header.SourceLoc, 0, true, 5, "", "", true, XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);

foreach (Worksheet Sheet in WorkBook.Worksheets)
{
    if (Sheet.Name.Trim().ToLower() == Header.SourceTable.Trim().ToLower())
    {
        foreach (DataColumn Col in Sheet.Columns)
        {
            string s = Col.ToString();
        }

        break;
    }

}


Everything makes sense in someone's mind

AnswerRe: Fill Collection With Excel Sheet Column Names Pin
dan!sh 16-Oct-09 7:32
professional dan!sh 16-Oct-09 7:32 
QuestionSerial Communication Pin
dwolver16-Oct-09 6:32
dwolver16-Oct-09 6:32 
AnswerRe: Serial Communication Pin
Luc Pattyn16-Oct-09 6:59
sitebuilderLuc Pattyn16-Oct-09 6:59 
GeneralRe: Serial Communication Pin
dwolver16-Oct-09 7:03
dwolver16-Oct-09 7:03 
GeneralRe: Serial Communication Pin
Luc Pattyn16-Oct-09 7:56
sitebuilderLuc Pattyn16-Oct-09 7:56 
GeneralRe: Serial Communication Pin
dybs16-Oct-09 18:44
dybs16-Oct-09 18:44 
QuestionHow to store words for a dictionary? Pin
Yednekachew16-Oct-09 6:30
Yednekachew16-Oct-09 6:30 
AnswerRe: How to store words for a dictionary? Pin
_Madmatt16-Oct-09 6:34
_Madmatt16-Oct-09 6:34 
AnswerRe: How to store words for a dictionary? Pin
Luc Pattyn16-Oct-09 6:46
sitebuilderLuc Pattyn16-Oct-09 6:46 
GeneralRe: How to store words for a dictionary? Pin
Yednekachew16-Oct-09 6:52
Yednekachew16-Oct-09 6:52 
GeneralRe: How to store words for a dictionary? Pin
Luc Pattyn16-Oct-09 6:55
sitebuilderLuc Pattyn16-Oct-09 6:55 
GeneralRe: How to store words for a dictionary? Pin
Dan Neely16-Oct-09 7:12
Dan Neely16-Oct-09 7:12 
GeneralRe: How to store words for a dictionary? Pin
Luc Pattyn16-Oct-09 7:59
sitebuilderLuc Pattyn16-Oct-09 7:59 
JokeRe: How to store words for a dictionary? Pin
Dan Neely16-Oct-09 8:24
Dan Neely16-Oct-09 8:24 
GeneralRe: How to store words for a dictionary? Pin
Luc Pattyn16-Oct-09 8:36
sitebuilderLuc Pattyn16-Oct-09 8:36 
GeneralRe: How to store words for a dictionary? Pin
PIEBALDconsult16-Oct-09 14:20
mvePIEBALDconsult16-Oct-09 14:20 
AnswerRe: How to store words for a dictionary? Pin
PIEBALDconsult16-Oct-09 7:01
mvePIEBALDconsult16-Oct-09 7:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.