Read Excel File from C#

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2008
Posts: 100
Reputation: Tank50 is an unknown quantity at this point 
Solved Threads: 1
Tank50's Avatar
Tank50 Tank50 is offline Offline
Junior Poster

Read Excel File from C#

 
0
  #1
Apr 28th, 2009
Hi

Once I wrote below coding it give error meassage.Error meassage is "Member not found".I wrote red color that show the error meassage is occur.

  
 Microsoft.Office.Interop.Excel.Application xl = new Microsoft.Office.Interop.Excel.Application();
Excel.Workbook xlWorkBook = (Excel.Workbook)xl.Workbooks.Open("D:\\Test\\VOIP_X.xls", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
            Excel.Worksheet xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets("1");
            Excel.Range r  = (Excel.Range)xlWorkSheet.Range("A30", "A30");
             MessageBox.Show(r.Value.ToString());


Thanks
Tank50
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 18
Reputation: mahendrabilla is an unknown quantity at this point 
Solved Threads: 1
mahendrabilla mahendrabilla is offline Offline
Newbie Poster

Re: Read Excel File from C#

 
0
  #2
Apr 28th, 2009
Check the below article. Sure it will help

http://support.microsoft.com/kb/328347
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 100
Reputation: Tank50 is an unknown quantity at this point 
Solved Threads: 1
Tank50's Avatar
Tank50 Tank50 is offline Offline
Junior Poster

Re: Read Excel File from C#

 
0
  #3
Apr 28th, 2009
Hi

I think its for create new excel file,but I need to read excel file

Thnaks
Tank50
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 18
Reputation: mahendrabilla is an unknown quantity at this point 
Solved Threads: 1
mahendrabilla mahendrabilla is offline Offline
Newbie Poster

Re: Read Excel File from C#

 
0
  #4
Apr 28th, 2009
oRng.Cells(nRows, nCols).Value

By using the above line, you can read as well.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 100
Reputation: Tank50 is an unknown quantity at this point 
Solved Threads: 1
Tank50's Avatar
Tank50 Tank50 is offline Offline
Junior Poster

Re: Read Excel File from C#

 
0
  #5
Apr 29th, 2009
HI

Previously I had Microsoft office 2007,so I installed office 2003 and I used Microsoft 11.0 object Library.Now Its working,

Thanks
Tank50
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2815 | Replies: 4
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC