CoderSource.net
Search
Re: Convert excel file ti text file
Started by kumalanChetty at 12-22-2005 11:55 PM. Topic has 2 replies.

Print Search « Previous Thread Next Thread »
   12-22-2005, 11:55 PM
kumalanChetty is not online. Last active: 12/23/2005 5:01:54 AM kumalanChetty

Top 25 Posts
Joined on 12-23-2005
Posts 2
Zip it! [:#] Convert excel file ti text file

hi ...

i wud appreciate any help in this reagrd...

i need to convert an excel file to a .txt file...

thank you

kumalan


   Report 
   12-24-2005, 12:58 AM
Muthu is not online. Last active: 11/15/2006 1:27:50 AM Muthu

Top 10 Posts
Joined on 06-18-2005
Posts 10
Re: Convert excel file ti text file
You can try using Excel.Application object. Add the Microsoft Excel Object Library (9.0) to your Microsoft Visual Studio .Net reference and use the Excel object there.

Hope This Helps

Muthu

Muthu
   Report 
   12-26-2005, 11:03 PM
kumalanChetty is not online. Last active: 12/23/2005 5:01:54 AM kumalanChetty

Top 25 Posts
Joined on 12-23-2005
Posts 2
Re: Convert excel file ti text file

yes i have done that ...i can open an excel file but im having problem writing to the text file ....this is wat im doing....

string fileName = @"c:\Sales 258.xls";

IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);

Excel.Workbook theWorkbook =

ExcelObj.Workbooks._Open(

fileName, 0, true, 5,

"", "", true, Excel.XlPlatform.xlWindows, "\t", false, false,

0, true);

System.Array myvalues = (System.Array)range.Cells.Value2;

string[] strArray = ConvertToStringArray(myvalues);

StreamWriter writer = new StreamWriter(new IsolatedStorageFileStream(@"c:\e.txt",FileMode.CreateNew,isoStore));

writer.WriteLine(strArray);

and its not working....it gives me a n error telling me that the excel file is already in use and canot be written into..

pls help..

thanks.

kumalan...


   Report 
Codersource.Net » Programming » C# Programming » Re: Convert excel file ti text file

MENU
Home
MFC 
C++
.Net
WIN32
Programming
Forum
My Articles
Welcome to Codersource.Net Login | Register | Faq  

Google
 

NOTES:


Thanks for visiting our CoderSource.net. This site will be improved with more articles. Interested visitors can also submit their articles through the Submit Article link.Your article will also be published after due consideration by the editor. 

© Copyright 2003. All rights on content reserved by CoderSource.net. Contact    About Us