Click here to Skip to main content
15,885,925 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello everyone.

I have a minor problem, it seems very easy but Im new to the excel libraries.

I need a small window (C#, VS2010 made) which has the following functionality:

It browses for two .xls files and once chosen it copies the values of the first sheet1's data for range A1:A5 for example to the second file in some location for example B1:B5.

Thanks
Posted
Updated 15-Oct-12 4:19am
v2
Comments
[no name] 15-Oct-12 10:20am    
And how exactly is this a problem? This is not even a question.
[no name] 16-Oct-12 2:48am    
If you ask the free source, I think it is hard to find, everybody know iTEXTSHARP is a free pdf tool,but few know a free excel tool.

 
Share this answer
 
Comments
mkheidzedavid 15-Oct-12 10:23am    
Thanks. Is there similar file in C# rather than VB?
fjdiewornncalwe 15-Oct-12 10:28am    
That is a very simple conversion. Look at the VB code as pseudo code and build the C# yourself from that. There is very little code involved so the process should be quite trivial.
Sergey Alexandrovich Kryukov 15-Oct-12 14:32pm    
Right, a 5.
--SA
It doesn't quite work like that.
We do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to VWorker.com and ask there.

But be aware: you get what you pay for. You are not going to get a first class programmer for $15.
 
Share this answer
 
Comments
mkheidzedavid 15-Oct-12 10:25am    
Im just asking if there is any open source project like above suggested one in C#. If not I need a way to follow. Suggestions which path to take or an article to read.
XML
I do not know such a free tool,but you can try below code:
<pre lang="c#">            Workbook workbook = new Workbook();
            workbook.LoadFromFile(@&quot;..\excel1.xls&quot;, ExcelVersion.Version97to2003);
            Workbook workbook2 = new Workbook();
            workbook2.LoadFromFile(@&quot;..\excel2.xls&quot;, ExcelVersion.Version97to2003);
            Worksheet sheet2 = workbook2.Worksheets[0];
            DataTable dataTable = sheet2.ExportDataTable();
            Worksheet sheetAdd = workbook.CreateEmptySheet(&quot;Country&quot;);
            sheetAdd.InsertDataTable(dataTable, true, 1, 1);</pre>
 
Share this answer
 

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