void get_columnheads() { cbColumn.Items.Clear(); cbColumn.Text = ""; AutoCompleteStringCollection nac; List <string> ts; Program.all_cells = new List <List <string> >(); Program.start_row = (long)lStartRow.Value; Program.col_values = new List <AutoCompleteStringCollection>(); Program.col_index = new List <long>(); for (int c = 1; c <= 50; c++) { if (Program.sheet.Cells[Program.start_row, c].Value != null) { if (Program.sheet.Cells[Program.start_row, c].Value.ToString().Length > 0) { cbitem i = new cbitem(c, Program.sheet.Cells[Program.start_row, c].Value.ToString()); cbColumn.Items.Add(i); Program.col_index.Add(c); nac = new AutoCompleteStringCollection(); ts = new List <string>(); fill_col_values(ref nac, ref ts, c); Program.all_cells.Add(ts); Program.col_values.Add(nac); } } } if (cbColumn.Items.Count > 0) { cbColumn.SelectedIndex = 0; } }
void load_sheets() { cbSheet.Items.Clear(); int i = 1; foreach (Microsoft.Office.Interop.Excel.Worksheet ws in Program.book.Worksheets) { cbitem item = new cbitem(i, ws.Name); cbSheet.Items.Add(item); i++; } Program.start_row = (long)lStartRow.Value + 1; Program.row = Program.start_row; cbSheet.SelectedIndex = 0; }