473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to read a excel file in c#.net

i have to read a excel file in fornt end essentially in asp/c#.net.
the row column value from the excel file has to be assigned to c# variable for further processing. i wanna know how to open connection to read the file and data.
Aug 22 '07 #1
3 2036
vinci
62
i have to read a excel file in fornt end essentially in asp/c#.net.
the row column value from the excel file has to be assigned to c# variable for further processing. i wanna know how to open connection to read the file and data.

hi! welcome to TSDN!

u can access data from excel by using Microsoft.Office.Interop.Excel assembly..

u can research about this assembly and how to use it...

hope it helps!
Aug 22 '07 #2
buhnik
2
[You have to uesd
using Excel1 = Microsoft.Office.Interop.Excel;
Excel1.Application m_KeletoXL;
Excel1.Workbook m_KeletexcelWorkbook;
Excel1.Worksheet m_KeletoSheet;
Excel1.Range m_KeletRange;
Array m_myvalues;
m_oSheet[IndexShett].get_Range(rowStart, rowEnd).Font.Bold = true;
m_oSheet[IndexShett].get_Range(rowStart, rowEnd).Font.Color = ColorTranslator.ToWin32(m_ColorNumberOfProfiles[IndexShett]);
Aug 22 '07 #3
hi! welcome to TSDN!

u can access data from excel by using Microsoft.Office.Interop.Excel assembly..

u can research about this assembly and how to use it...

hope it helps!
i m trying to declare an object of Application type using the code as below
Expand|Select|Wrap|Line Numbers
  1.  
  2. Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application()
  3.  
  4.  
it's giving me following error
UnauthorizedAccessException was handled
i tried resolving it by DCOMCNFG to set an ASPNET account,still i m getting the same error.
what to do/
Aug 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: QQ | last post by:
I am trying to read data from Excel files I use the following codes, however, it didn't work Can anyone tell me what the format excel files have, what I should do to read it from C? Thanks a...
0
by: Peter | last post by:
I am having a problem reading an Excel file that is XML based. The directory I am reading contains Excel files that can be of two types. Either generic Microsoft based or XML based. I am reading...
1
by: Roger Twomey | last post by:
I have a form that allows a user to upload a microsoft Excel Spreadsheet. (I am testing with one created in Excel 2000) The spreadsheet is uploaded correctly. It is then supposed to be read...
2
by: Reza Solouki | last post by:
Hello, I never had to do anything with office tools programmatically till now(I guess there is first time for everything), so this might be a very silly and simple question for some of you. Any...
4
by: Seok Bee | last post by:
Dear Experts, I have created a script to extract the Event Logs from the system into an excel sheet. The logs are separated into 2 worksheets (Application Log and System Log). After this excel...
1
by: ashok0866 | last post by:
I had created a macro to read data from an excel sheet and write the values to a text file. I had used "ActiveSheet.Range("GB" & k).Value" command to read the values from the excel. The issue...
2
by: wstsoi | last post by:
hi I have to read images from spreadsheet, is it possible to do with php?
4
by: sukhmeet | last post by:
Hi, I am trying to load a csv file in Iframe element. I just want to load it as a text file. however when i load the file in iframe it asks to open the file and finally opens it with excel in IE...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.