Date,Open,High,Low,Close,Volume
1980-12-12,0.0000,3.6094,3.5938,3.5938,16751200
1980-12-15,0.0000,3.4219,3.4063,3.4063,6281600
1980-12-16,0.0000,3.1719,3.1563,3.1563,3776000
1980-12-17,0.0000,3.25,3.2344,3.2344,3087200
1980-12-18,0.0000,3.3438,3.3282,3.3282,2623200
1980-12-19,0.0000,3.5469,3.5313,3.5313,1736800 this is the mmeDloadedData.Text
I need them not to be all in one cell. But as you guess in separate cells. I cannot use Data=>Text To Columns menu option here because the string is in A1 cell. What can I do?
Thanks in advance!
private void bbtExport_ItemClick(object sender, ItemClickEventArgs e)
{
//Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();
//xlApp = new Excel.ApplicationClass();
xlWorkBook = xlApp.Workbooks.Add(misValue);
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
xlWorkSheet.Cells[1,1] = mmeDloadedData.Text;
xlWorkBook.SaveAs("StockQuotes.xls", Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
releaseObject(xlWorkSheet);
releaseObject(xlWorkBook);
releaseObject(xlApp);
XtraMessageBox.Show("Excel file created, you can find the file c:\\StockQuotes.xls", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
This post has been edited by tsotne1990: 22 November 2011 - 03:14 PM

New Topic/Question
Reply




MultiQuote





|