Click here to Skip to main content
12,253,990 members (63,218 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# MS-Excel
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 15-Oct-12 4:18am
Edited 15-Oct-12 4:19am
v2
Comments
Wes Aday 15-Oct-12 10:20am
   
And how exactly is this a problem? This is not even a question.
Lacy00 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.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
mkheidzedavid 15-Oct-12 10:23am
   
Thanks. Is there similar file in C# rather than VB?
Marcus Kramer 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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
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.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

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>
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 16 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100