Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default selectfile control

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default selectfile control

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default selectfile control

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default selectfile control

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default selectfile control

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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default selectfile control

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
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
2007 Form Control/ActiveX Control font difference Nikko963 Excel Discussion (Misc queries) 0 April 15th 09 04:21 PM
Excel spin box - no Control tab in Format Control dialong box tocoau Excel Worksheet Functions 7 August 10th 08 03:15 PM
Difference between a Forms Control verus Active-X Control funGT350 Excel Discussion (Misc queries) 6 May 6th 08 11:20 PM
Set Focus Problem for textbox control on multipage control ExcelDeveloperSPR Excel Programming 1 July 16th 04 08:54 PM
Calendar Control: Can't exit design mode because control can't be created Rone Excel Programming 0 May 24th 04 04:01 PM


All times are GMT +1. The time now is 02:53 AM.

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

About Us

"It's about Microsoft Excel"