Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,
I am working on a project for manipulate excel datas.

I have an excel report from a machine gives me this data automatically. But this data needs to be manipulate and edit.

I want to a program for do this automatically.

Now i have 2 excel file. One of them from machine, other one is edited template. I want to find the right data from machine's excels and write to template. I can use id option for the find the data. And when i find the data, i need to write this data to template on the same id column.

I look at the articles and there is 2 main way to do it. One of them Interop and other way is the use OleDb.

Now, excel's versions can be change on other computers, so which way is the better for do this ?

Thank you.

What I have tried:

I looked the articles on the web.
Posted
Updated 10-Feb-17 22:40pm

1 solution

Interop requires Microsoft Office installed on the machine that is running your app - if it isn't installed, then Interop will not work at all. On that basis, OleDB would be a better option for a generic operation.

[edit]
However, I don't use either for reading: c# - Read data from an Excel file - Stack Overflow[^] - see the Velkumar solution, it works very nicely.
[/edit]
 
Share this answer
 
v2
Comments
kozmikadam 12-Feb-17 4:33am    
Hi,
i'm using OleDB for my project. I want to ask, is there any other way for update data from datagridview to excel or need i use oledb command for that ? ? i don't want to create a new excel file, i want to edit old one which i imported it to datagridview.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900