G
Guest
My form has a listview control, set to show detail view. It has 2 columns:
workbooks and worksheets
I run the following code, trying to get each Excel workbook name as a main
item and each worksheet as a new subordinate item. Some open workbooks have
1 worksheet, but one has 11 worksheets. so, I'm expecting to see
Workbook1
worksheet1
worksheet2
Workbook2
worksheet1
worksheet2
worksheet3
and so forth
No matter what I do the listivew only shows a single line for each workbook
with that workbook's first worksheet on that same line. It's probably
something simple, but the the heck am I missing??
For Each wb In xl.Workbooks
lvi = New ListViewItem(wb.Name)
For Each ws In wb.Worksheets
lvi.SubItems.Add(ws.Name)
Next
Me.WorkbooksListview.Items.Add(lvi)
Next
workbooks and worksheets
I run the following code, trying to get each Excel workbook name as a main
item and each worksheet as a new subordinate item. Some open workbooks have
1 worksheet, but one has 11 worksheets. so, I'm expecting to see
Workbook1
worksheet1
worksheet2
Workbook2
worksheet1
worksheet2
worksheet3
and so forth
No matter what I do the listivew only shows a single line for each workbook
with that workbook's first worksheet on that same line. It's probably
something simple, but the the heck am I missing??
For Each wb In xl.Workbooks
lvi = New ListViewItem(wb.Name)
For Each ws In wb.Worksheets
lvi.SubItems.Add(ws.Name)
Next
Me.WorkbooksListview.Items.Add(lvi)
Next