this is my source code where i populated my combobox from excel sheet sheet name but
i am unable to get value of index on the same event
private void button5_Click(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
if (op.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
textinput.Text = op.FileName;
}
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
xlApp = new Excel.Application();
xlWorkBook = xlApp.Workbooks.Open(textinput.Text, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
object misValue = System.Reflection.Missing.Value;
List<string> sheetname = new List<string>();
foreach (Microsoft.Office.Interop.Excel.Worksheet wSheet in xlWorkBook.Worksheets)
{
sheetname.Add(wSheet.Name);
}
comboBox2.DataSource = sheetname;
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
releaseObject(xlWorkBook);
releaseObject(xlApp);
}
when i am trying to get combobox2.selectindex by changing combo drop down ,always getting 0 as index value on the same event ,is there any way to get select index value
plz help.my combobox is populating the sheet name correctly,but not getting the index value???