Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default TreeView in Excel VBA

Is there any way to show the list that I have on a spreadsheet (see
image) on a TreeView Control using Excel VBA?

http://img135.imageshack.us/img135/6...enprintiv2.png

It is nothing but a list of folders gotten from somewhere using the
shell command and each folder put into 1 column of the Excel. I
basically want that structure to be shown on a User form with the
appropriate structure maintained...thought it may be possible using
Treeview? I have never used Treeview earlier, hence I have no idea how
to use it...any pointers will be greatly appreciated.

Thanks much!
Satish

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,489
Default TreeView in Excel VBA

Hi,

You should find Colo's explanation helpful.
http://puremis.net/excel/code/080.shtml

Cheers
Andy

wrote:
Is there any way to show the list that I have on a spreadsheet (see
image) on a TreeView Control using Excel VBA?

http://img135.imageshack.us/img135/6...enprintiv2.png

It is nothing but a list of folders gotten from somewhere using the
shell command and each folder put into 1 column of the Excel. I
basically want that structure to be shown on a User form with the
appropriate structure maintained...thought it may be possible using
Treeview? I have never used Treeview earlier, hence I have no idea how
to use it...any pointers will be greatly appreciated.

Thanks much!
Satish

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default TreeView in Excel VBA

Hi Andy

Thanks for the link...it was certainly very helpful. My requirement is
a bit different...but it will help me at least get started...Here is my
exact requirement:

I want the list of folders to be displayed to the user (which I think I
can work out from the sample example provided in your link)... But I
want something more...

I want the user to be able to delete/add/modify folders (nodes in this
case). Something like the explorer in Windows, where if a user deletes
a folder (node) all sub-folders (nodes within that node) must be
deleted...

Do let me know in case anyone has worked on something like this...
thanks for reading...

-Satish

Andy Pope wrote:
Hi,

You should find Colo's explanation helpful.
http://puremis.net/excel/code/080.shtml

Cheers
Andy

wrote:
Is there any way to show the list that I have on a spreadsheet (see
image) on a TreeView Control using Excel VBA?

http://img135.imageshack.us/img135/6...enprintiv2.png

It is nothing but a list of folders gotten from somewhere using the
shell command and each folder put into 1 column of the Excel. I
basically want that structure to be shown on a User form with the
appropriate structure maintained...thought it may be possible using
Treeview? I have never used Treeview earlier, hence I have no idea how
to use it...any pointers will be greatly appreciated.

Thanks much!
Satish


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,489
Default TreeView in Excel VBA

You just need to know which node is selected and then remove it.

Private Sub TreeView1_KeyDown(KeyCode As Integer, _
ByVal Shift As Integer)

Dim nodTemp As Node

If KeyCode = vbKeyDelete Then
Set nodTemp = TreeView1.SelectedItem
If MsgBox("Are you sure you want to delete " & _
nodTemp.Text, vbYesNo Or vbQuestion) = vbYes Then
TreeView1.Nodes.Remove nodTemp.Index
End If
End If

End Sub

Cheers
Andy

Satish wrote:
Hi Andy

Thanks for the link...it was certainly very helpful. My requirement is
a bit different...but it will help me at least get started...Here is my
exact requirement:

I want the list of folders to be displayed to the user (which I think I
can work out from the sample example provided in your link)... But I
want something more...

I want the user to be able to delete/add/modify folders (nodes in this
case). Something like the explorer in Windows, where if a user deletes
a folder (node) all sub-folders (nodes within that node) must be
deleted...

Do let me know in case anyone has worked on something like this...
thanks for reading...

-Satish

Andy Pope wrote:

Hi,

You should find Colo's explanation helpful.
http://puremis.net/excel/code/080.shtml

Cheers
Andy

wrote:

Is there any way to show the list that I have on a spreadsheet (see
image) on a TreeView Control using Excel VBA?

http://img135.imageshack.us/img135/6...enprintiv2.png

It is nothing but a list of folders gotten from somewhere using the
shell command and each folder put into 1 column of the Excel. I
basically want that structure to be shown on a User form with the
appropriate structure maintained...thought it may be possible using
Treeview? I have never used Treeview earlier, hence I have no idea how
to use it...any pointers will be greatly appreciated.

Thanks much!
Satish



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default TreeView in Excel VBA

Thanx Andy!

Andy Pope wrote:
You just need to know which node is selected and then remove it.

Private Sub TreeView1_KeyDown(KeyCode As Integer, _
ByVal Shift As Integer)

Dim nodTemp As Node

If KeyCode = vbKeyDelete Then
Set nodTemp = TreeView1.SelectedItem
If MsgBox("Are you sure you want to delete " & _
nodTemp.Text, vbYesNo Or vbQuestion) = vbYes Then
TreeView1.Nodes.Remove nodTemp.Index
End If
End If

End Sub

Cheers
Andy

Satish wrote:
Hi Andy

Thanks for the link...it was certainly very helpful. My requirement is
a bit different...but it will help me at least get started...Here is my
exact requirement:

I want the list of folders to be displayed to the user (which I think I
can work out from the sample example provided in your link)... But I
want something more...

I want the user to be able to delete/add/modify folders (nodes in this
case). Something like the explorer in Windows, where if a user deletes
a folder (node) all sub-folders (nodes within that node) must be
deleted...

Do let me know in case anyone has worked on something like this...
thanks for reading...

-Satish

Andy Pope wrote:

Hi,

You should find Colo's explanation helpful.
http://puremis.net/excel/code/080.shtml

Cheers
Andy

wrote:

Is there any way to show the list that I have on a spreadsheet (see
image) on a TreeView Control using Excel VBA?

http://img135.imageshack.us/img135/6...enprintiv2.png

It is nothing but a list of folders gotten from somewhere using the
shell command and each folder put into 1 column of the Excel. I
basically want that structure to be shown on a User form with the
appropriate structure maintained...thought it may be possible using
Treeview? I have never used Treeview earlier, hence I have no idea how
to use it...any pointers will be greatly appreciated.

Thanks much!
Satish




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Excel docs not saving as excel docs Beth Excel Discussion (Misc queries) 6 September 12th 06 02:39 AM
Open Excel 2003 from Windows Explorer pmpjr Excel Discussion (Misc queries) 9 September 11th 06 03:58 PM
Need suggestions for some uses of Ms Excel Bible John Excel Discussion (Misc queries) 1 February 27th 06 06:30 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM


All times are GMT +1. The time now is 07:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"