Hi!
Im having a bit of trouble... im trying to convert an excel
spreadsheet cell value to a string! But all I get is "System.__COM"
in my string variable...
this.openFileDialog1.FileName = "*.xls";
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
{
//System.Threading.Thread.CurrentThread.CurrentUICul ture = new
System.Globalization.CultureInfo("en-US");
InitializeComponent();
ExcelObj = new Excel.Application(); //openFileDialog1.FileName //
openFileDialog1.FileName //"C:\\Documents and Settings\\MTSUser\\My
Documents\\Visual Studio Projects\\WindowsApplication1\\bin\\Debug\
\Countries.xls"
Excel.Workbook xwSpreadsheet = ExcelObj.Workbooks.Open("C:\
\Documents and Settings\\MTSUser\\My Documents\\Visual Studio Projects\
\WindowsApplication1\\bin\\Debug\\Countries.xls",0 ,false,
5,"","",true,Excel.XlPlatform.xlWindows,"",true,fa lse,
0,false,true,false);
//Excel.Workbook xwSpreadsheet =
ExcelObj.Workbooks.Open(openFileDialog1.FileName,0 ,false,
5,"","",true,Excel.XlPlatform.xlWindows,"",true,fa lse,
0,false,true,false);
Excel.Sheets sheets = xwSpreadsheet.Worksheets;
Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(1);
for (int i = 1; i <= 10; i++)
{
String yMYCALLVALUE = (worksheet.Cells[1,1]); //doesn't work
//MessageBox.Show(yMYCALLVALUE);
}
}