mahe.helal
New member
- Joined
- Jun 15, 2010
- Messages
- 3
- Programming Experience
- Beginner
hi,
I have an event called "worksheet_selectionchanged" which occurs when a range/cell is selected in an excle file.When the event is triggered, all the tabpages in a tabcontrol should be removed.
The code is given below:
but when ever i select a cell in the excel file, the tabpages seems to be "not removed".
Can anyone please help?
I have an event called "worksheet_selectionchanged" which occurs when a range/cell is selected in an excle file.When the event is triggered, all the tabpages in a tabcontrol should be removed.
The code is given below:
VB.NET:
Private Sub myWorksheet_SelectionChange(ByVal Target As Excel.Range) Handles myWorksheet.SelectionChange
for each tabpagesToRemove as TabPage in tabcontrol1.tabpages
tabcontrol1.tabpages.remove(tabpagesToRemove)
next
end sub
but when ever i select a cell in the excel file, the tabpages seems to be "not removed".
Can anyone please help?