Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i need a control that will return a "path"
can i use a "selectfile" or another control in a form, and how do i use it (an exemple will be greatly appreciated) thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The example below will display the Windows directory dialog and let a user
select any directory. It will return the path to that directory. Place this type declaration and the next two functions at 'the top of the module Public Type BROWSEINFO hWndOwner As Long pidlRoot As Long sDisplayName As String sTitle As String ulFlags As Long lpfn As Long lParam As Long iImage As Long End Type Declare Function SHGetPathFromIDList Lib "shell32.dll" _ Alias "SHGetPathFromIDListA" _ (ByVal pidl As Long, ByVal pszPath As String) As Long Declare Function SHBrowseForFolder Lib "shell32.dll" _ Alias "SHBrowseForFolderA" _ (lpBrowseInfo As BROWSEINFO) As Long Sub DemoGetPath() Dim anyPath As String anyPath = DirectoryName("Select destination folder") If anyPath = "" Then MsgBox "No directory selected" Else MsgBox anyPath End If Robert Flanagan Macro Systems Delaware, U.S. 302-234-9857 http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "al ramirez" wrote in message ... i need a control that will return a "path" can i use a "selectfile" or another control in a form, and how do i use it (an exemple will be greatly appreciated) thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob but:
DirectoryName("Select destination folder") is not defined, how do I use it, and what those 2 functions do?, can you elaborate a little bit more?. I'm a beginer. thanks again. Al -----Original Message----- The example below will display the Windows directory dialog and let a user select any directory. It will return the path to that directory. Place this type declaration and the next two functions at 'the top of the module Public Type BROWSEINFO hWndOwner As Long pidlRoot As Long sDisplayName As String sTitle As String ulFlags As Long lpfn As Long lParam As Long iImage As Long End Type Declare Function SHGetPathFromIDList Lib "shell32.dll" _ Alias "SHGetPathFromIDListA" _ (ByVal pidl As Long, ByVal pszPath As String) As Long Declare Function SHBrowseForFolder Lib "shell32.dll" _ Alias "SHBrowseForFolderA" _ (lpBrowseInfo As BROWSEINFO) As Long Sub DemoGetPath() Dim anyPath As String anyPath = DirectoryName("Select destination folder") If anyPath = "" Then MsgBox "No directory selected" Else MsgBox anyPath End If Robert Flanagan Macro Systems Delaware, U.S. 302-234-9857 http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "al ramirez" wrote in message ... i need a control that will return a "path" can i use a "selectfile" or another control in a form, and how do i use it (an exemple will be greatly appreciated) thanks in advance . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you want the approach explained, with a complete example, then you might
check the link I provided. -- Regards, Tom Ogilvy "al ramirez" wrote in message ... Thanks Bob but: DirectoryName("Select destination folder") is not defined, how do I use it, and what those 2 functions do?, can you elaborate a little bit more?. I'm a beginer. thanks again. Al -----Original Message----- The example below will display the Windows directory dialog and let a user select any directory. It will return the path to that directory. Place this type declaration and the next two functions at 'the top of the module Public Type BROWSEINFO hWndOwner As Long pidlRoot As Long sDisplayName As String sTitle As String ulFlags As Long lpfn As Long lParam As Long iImage As Long End Type Declare Function SHGetPathFromIDList Lib "shell32.dll" _ Alias "SHGetPathFromIDListA" _ (ByVal pidl As Long, ByVal pszPath As String) As Long Declare Function SHBrowseForFolder Lib "shell32.dll" _ Alias "SHBrowseForFolderA" _ (lpBrowseInfo As BROWSEINFO) As Long Sub DemoGetPath() Dim anyPath As String anyPath = DirectoryName("Select destination folder") If anyPath = "" Then MsgBox "No directory selected" Else MsgBox anyPath End If Robert Flanagan Macro Systems Delaware, U.S. 302-234-9857 http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "al ramirez" wrote in message ... i need a control that will return a "path" can i use a "selectfile" or another control in a form, and how do i use it (an exemple will be greatly appreciated) thanks in advance . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
http://j-walk.com/ss/excel/tips/tip29.htm
Selecting a Directory John Walkenbach's site -- Regards, Tom Ogilvy "al ramirez" wrote in message ... i need a control that will return a "path" can i use a "selectfile" or another control in a form, and how do i use it (an exemple will be greatly appreciated) thanks in advance |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom:
Thank you very very much, indeed !! Al -----Original Message----- http://j-walk.com/ss/excel/tips/tip29.htm Selecting a Directory John Walkenbach's site -- Regards, Tom Ogilvy "al ramirez" wrote in message ... i need a control that will return a "path" can i use a "selectfile" or another control in a form, and how do i use it (an exemple will be greatly appreciated) thanks in advance . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 Form Control/ActiveX Control font difference | Excel Discussion (Misc queries) | |||
Excel spin box - no Control tab in Format Control dialong box | Excel Worksheet Functions | |||
Difference between a Forms Control verus Active-X Control | Excel Discussion (Misc queries) | |||
Set Focus Problem for textbox control on multipage control | Excel Programming | |||
Calendar Control: Can't exit design mode because control can't be created | Excel Programming |