Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default using BrowseForFolder shell application

Hello !

I try to use this code :

Sub ChoixRepertoire()
Dim objShell As Object, objFolder As Object, oFolderItem As Object
Dim Chemin As String

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(&H0&, "Choisir un
répertoire", &H1&)

On Error Resume Next
Set oFolderItem = objFolder.Items.Item
Chemin = oFolderItem.Path

MsgBox Chemin
End Sub

I have Excel 2002, and Windows XP.

I'd like to block the user from dragging folders in that window. Is it
possible ?

I don't want the user to move folders while seleting it.

I've tried with the API, but I cannot set the root folder, so the user
doesn't go anywhere else in the tree

thanks !

tiah.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default using BrowseForFolder shell application

I don't see a way to block it. You might have to use:

Sub Test()
On Error Resume Next
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
MsgBox .SelectedItems(1)
End With
End Sub


--
Jim
"tiah" wrote in message
...
Hello !

I try to use this code :

Sub ChoixRepertoire()
Dim objShell As Object, objFolder As Object, oFolderItem As Object
Dim Chemin As String

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(&H0&, "Choisir un
répertoire", &H1&)

On Error Resume Next
Set oFolderItem = objFolder.Items.Item
Chemin = oFolderItem.Path

MsgBox Chemin
End Sub

I have Excel 2002, and Windows XP.

I'd like to block the user from dragging folders in that window. Is it
possible ?

I don't want the user to move folders while seleting it.

I've tried with the API, but I cannot set the root folder, so the user
doesn't go anywhere else in the tree

thanks !

tiah.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default using BrowseForFolder shell application

thanks Jim, I cannot use that, since user will see the whole path.

do you know how to set the "top folder" ? to the api ?

On 5 mar, 12:07, "Jim Rech" wrote:
I don't see a way to block it. *You might have to use:

Sub Test()
* * On Error Resume Next
* * With Application.FileDialog(msoFileDialogFolderPicker)
* * * * .Show
* * * * MsgBox .SelectedItems(1)
* * End With
End Sub

--
Jim"tiah" wrote in message

...
Hello !

I try to use this code :

Sub ChoixRepertoire()
* *Dim objShell As Object, objFolder As Object, oFolderItem As Object
* * Dim Chemin As String

* * Set objShell = CreateObject("Shell.Application")
* * Set objFolder = objShell.BrowseForFolder(&H0&, "Choisir un
répertoire", &H1&)

* * On Error Resume Next
* * Set oFolderItem = objFolder.Items.Item
* * Chemin = oFolderItem.Path

* * MsgBox Chemin
End Sub

I have Excel 2002, and Windows XP.

I'd like to block the user from dragging folders in that window. Is it
possible ?

I don't want the user to move folders while seleting it.

I've tried with the API, but I cannot set the root folder, so the user
doesn't go anywhere else in the tree

thanks !

tiah.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default using BrowseForFolder shell application

I haven't looked at it in years but I never had any luck setting the top
folder using the API method, other than to a system folder. All I could do
was set the initial folder using a callback.

--
Jim
"tiah" wrote in message
...
thanks Jim, I cannot use that, since user will see the whole path.

do you know how to set the "top folder" ? to the api ?

On 5 mar, 12:07, "Jim Rech" wrote:
I don't see a way to block it. You might have to use:

Sub Test()
On Error Resume Next
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
MsgBox .SelectedItems(1)
End With
End Sub

--
Jim"tiah" wrote in message

...
Hello !

I try to use this code :

Sub ChoixRepertoire()
Dim objShell As Object, objFolder As Object, oFolderItem As Object
Dim Chemin As String

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(&H0&, "Choisir un
répertoire", &H1&)

On Error Resume Next
Set oFolderItem = objFolder.Items.Item
Chemin = oFolderItem.Path

MsgBox Chemin
End Sub

I have Excel 2002, and Windows XP.

I'd like to block the user from dragging folders in that window. Is it
possible ?

I don't want the user to move folders while seleting it.

I've tried with the API, but I cannot set the root folder, so the user
doesn't go anywhere else in the tree

thanks !

tiah.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default using BrowseForFolder shell application

Hello Jim,

thanks for your help. I think i will use a tree view :)

On 5 mar, 14:00, "Jim Rech" wrote:
I haven't looked at it in years but I never had any luck setting the top
folder using the API method, other than to a system folder. *All I could do
was set the initial folder using a callback.

--
Jim"tiah" wrote in message

...
thanks Jim, I cannot use that, since user will see the whole path.

do you know how to set the "top folder" ? to the api ?

On 5 mar, 12:07, "Jim Rech" wrote:



I don't see a way to block it. You might have to use:


Sub Test()
On Error Resume Next
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
MsgBox .SelectedItems(1)
End With
End Sub


--
Jim"tiah" wrote in message


...
Hello !


I try to use this code :


Sub ChoixRepertoire()
Dim objShell As Object, objFolder As Object, oFolderItem As Object
Dim Chemin As String


Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(&H0&, "Choisir un
répertoire", &H1&)


On Error Resume Next
Set oFolderItem = objFolder.Items.Item
Chemin = oFolderItem.Path


MsgBox Chemin
End Sub


I have Excel 2002, and Windows XP.


I'd like to block the user from dragging folders in that window. Is it
possible ?


I don't want the user to move folders while seleting it.


I've tried with the API, but I cannot set the root folder, so the user
doesn't go anywhere else in the tree


thanks !


tiah.- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -


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
BrowseForFolder [email protected] Excel Programming 4 December 24th 05 12:06 AM
Return to Excel after shell an application abc[_6_] Excel Programming 1 September 12th 05 11:25 AM
SHELL to open an application and pass parameters to it jwkz Excel Programming 3 August 12th 05 09:41 PM
Shell can open an application, can it close an app too? quartz[_2_] Excel Programming 4 April 26th 05 03:30 PM
Application Process-Shell Command GarethG[_10_] Excel Programming 2 October 29th 03 01:35 PM


All times are GMT +1. The time now is 05:44 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"