to answer my own question...:)
i figured it out, much simpler than i thought
so if anyone has a similar question, hope this helps:
it pulls data out of a listview and pumps it into Excel 2007.
Make sure you have the correct references.
-
Microsoft.Office.Interop.Excel.Application xla = new Microsoft.Office.Interop.Excel.Application();
-
-
xla.Visible = true;
-
Workbook wb = xla.Workbooks.Add(XlSheetType.xlWorksheet);
-
Worksheet ws = (Worksheet)xla.ActiveSheet;
-
int i = 1;
-
int j = 1;
-
foreach (ListViewItem comp in lvwResults.Items)
-
{
-
ws.Cells[i, j] = comp.Text.ToString();
-
//MessageBox.Show(comp.Text.ToString());
-
foreach (ListViewItem.ListViewSubItem drv in comp.SubItems)
-
{
-
ws.Cells[i, j] = drv.Text.ToString();
-
j++;
-
}
-
j = 1;
-
i++;