Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I need to import an Excel file from my PC in a button click. What is the function that helps me to do that?

Any one can help me?

Thanks
Posted
Updated 2-Dec-10 23:55pm
v2

 
Share this answer
 
v2
Thank you for your question. You can follow the code bellow.

C#
Excel.Workbook wb = 
    ThisApplication.Workbooks.OpenText("C:\\Test.txt", 
    Type.Missing, 3, Excel.XlTextParsingType.xlDelimited, 
    Excel.XlTextQualifier.xlTextQualifierDoubleQuote, 
    Type.Missing, Type.Missing, Type.Missing, True, 
    Type.Missing, Type.Missing, Type.Missing, 
    Type.Missing, Type.Missing, Type.Missing, 
    Type.Missing, Type.Missing, Type.Missing);



Helpful Link:http://msdn.microsoft.com/en-us/library/aa168292(office.11).aspx[^]
http://support.microsoft.com/kb/301982[^]

Thanks,
Mamun
 
Share this answer
 
There are thousand of examples are available in the Net ..,

A simple Google Search Sloves your Problem..,

Go through the below link

Here[^]
 
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