|
|
|
Re: Convert excel file ti text file
Started by kumalanChetty at 12-22-2005 11:55 PM. Topic has 2 replies.
|
|
12-22-2005, 11:55 PM
|
kumalanChetty
Joined on 12-23-2005
Posts 2
|
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
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
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
|
|
|
|
| |
|