C# Excel Tutorial - #1 - Open and Read Excel Files

preview_player
Показать описание
Quick guide how to open and read excel file through C# application you are making.
Рекомендации по теме
Комментарии
Автор

What a Great Tutor <3 Perfectly Perfect!

tatolelashvili
Автор

Thank you very much for this guide, it's very helpful!

XxxDjNikxxX
Автор

The easiest way availlable on the internet ! A big thank from a french student !

schwarzyzz
Автор

Hi! Thank you! How to close excel correctly? Even if I close VS after this code, my excel file doesn't open for editing.

yqsxwin
Автор

These Tutorials are really helpful. Thank you. Does anyone have any idea how can i read the background color of a cell in Excel? I need this, so i can make the same color for the background of the textbox.

rronfrangu
Автор

Thanks for the tutorial. but I got this error:
'Retrieving the COM class factory for component with CLSID failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).'

Why?

armindashti
Автор

Hi, thank you for sharin your knowledge. I've tried the above. Everything works but i cant receive a list of items. Do i need to parse the readcell to a list? I thought the int i++ and j++ would return each value when not null and show it in the messagebox. Hope you can help out.

robvanbreemen
Автор

Thanks for the video! Could anybody explain to me please how can I close process named "excel" correctly in my task manager? After closing of my application I've got process named "microsoft excel". If I run my app several times I get several unclosed processes "microsoft excel". Actually I use my excel table once to copy data to array into C# and I don't need use excel anymore up to next launch of my application.

LEpd
Автор

This is one of the best tutorials I've found and has gotten me the closest to a working excel function! Thank you very much. I'm hoping someone can answer my question though because it doesn't make sense to me. If I name the class "ExcelClass" rather than just "Excel" like in the tutorial OR if I change the "public Excel(string path, int sheet)" method to "public ExcelOpen(string path, int sheet)" I get an error that says Method must have a return type.

Why would changing the name of the class or method throw this error?

dhannant
Автор

Hey Bospear, I just followed this tutorial, and everything runs great except that the MessageBox.WriteLine(excel.ReadCell(0, 0)); line doesn't pull up any message. I have a Test.xlsx file with a string in the correct box and have tried to output this message to the console instead, but still haven't gotten anything to pop up. Any ideas on what might be going wrong here?

karishmakate
Автор

Hi there! It's really interactive tutorial. I have a question, I have an error said that "Program does not contain a static 'Main' method suitable for an entry point". Also, I am a little bit confused where I need to put my excel document, maybe you could answer it?

anthonykurniajaya
Автор

Thank you very much! You helped me a lot! Do you have ideas how to read all data from .xlsx file, not just one column and row?

darius
Автор

Thanks for the video!. I'm starting at c# programming and there is something that i don't understand. why "wb" and "ws" don't have a "new" instance? aren't they an object?

yerkoantonioalvarez
Автор

We have all had problems with path=" ". But the tutorial served me. Thank you

paputec
Автор

help me, plesase : An unhandled exception of type occurred in WpfApplication1.exe

tuphanhoang
Автор

When I try to run Form1.cs, I receive the following popup window:

"A project with an Output Type of Class Library cannot be started directly. In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project."

It seems like I created Form1 as the wrong type of file. I know this is too basic of a question to be asking here, but do you have any recommendations of how to create it properly? I created it through File -> New -> Visual C# class

natedurand
Автор

@Bospear. How do you implement the Application Interface? I'm getting errors when using the _Application syntax.

coyotemoon
Автор

Hi i have one doubt how can we load same data to down list based on select query and condition

radhikakurakula
Автор

Sir I do have a problem, I put the line of path as this
Excel1 excel = new Excel1 API\first.xlsx", 1);
and it says we cannot find the address, althogh the address is correct

farshidmousavi
Автор

Do you not have to preface wb, ws and excel with 'this' in C# within the Excel constructor?

jeremyflowers