Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
hi my friends.

i have two button in my form. one button is "browse" for select a excel file.
next button is "save". now i want save excel data in 2D array.
(and i dont have any information about column and row)

how can i do this????
Thanks

What I have tried:

save excel data in array in C#
Posted
Updated 31-Mar-16 6:42am
Comments
CHill60 31-Mar-16 7:14am    
What have tried? What is your code?
Mohammad Hasanpoor 31-Mar-16 7:17am    
sorry, but i do not have any code.
because i can not do that.
Kenneth Haugland 31-Mar-16 7:30am    
Look at the VSTO command UsedRange
Mohammad Hasanpoor 31-Mar-16 7:32am    
but i didnt understand.
because i am not professional.
please help...
Kenneth Haugland 31-Mar-16 7:36am    
https://www.google.no/search?q=UsedRange&oq=UsedRange&aqs=chrome..69i57&sourceid=chrome&ie=UTF-8

1 solution

You can use Microsoft Open XML Format SDK. Please see my past answers:
Create a doc file from gridview or datatable records in asp.net c#[^],
Microsot office Interop[^].

See also these warnings from Microsoft on the use of Interop:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[^],
http://support.microsoft.com/kb/257757/en-us[^].

See also this answers with other references: How to add microsoft excel 15.0 object library from Add Reference in MS Visual Studio 2010[^].

—SA
 
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