Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Directory Browse/Search information

Hi,

I require to search for a directory path which is then used as a default for
saving a manipulated copy of the current worksheet. I have the information
regarding the saving of the sheet, but cannot get a search/browse form.

All help greatfully recieved.

RG


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Directory Browse/Search information

Private Declare Function SHGetPathFromIDList Lib "shell32.dll" _
Alias "SHGetPathFromIDListA" _
(ByVal pidl As Long, _
ByVal pszPath As String) As Long

Private Declare Function SHBrowseForFolder Lib "shell32.dll" _
Alias "SHBrowseForFolderA" _
(lpBrowseInfo As BROWSEINFO) As Long

Private Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type

'-------------------------------------------------------------
Function GetFolder(Optional ByVal Name As String = "Select a folder.")
As String
'-------------------------------------------------------------
Dim bInfo As BROWSEINFO
Dim path As String
Dim oDialog As Long

bInfo.pidlRoot = 0& 'Root folder = Desktop

bInfo.lpszTitle = Name

bInfo.ulFlags = &H1 'Type of directory to
return
oDialog = SHBrowseForFolder(bInfo) 'display the dialog

'Parse the result
path = Space$(512)

GetFolder = ""
If SHGetPathFromIDList(ByVal oDialog, ByVal path) Then
GetFolder = Left(path, InStr(path, Chr$(0)) - 1)
End If

End Function



--

HTH

RP

"ZH875" wrote in message
...
Hi,

I require to search for a directory path which is then used as a default

for
saving a manipulated copy of the current worksheet. I have the

information
regarding the saving of the sheet, but cannot get a search/browse form.

All help greatfully recieved.

RG




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
search folder/directory for a phrase inside excel files pwrichcreek Excel Discussion (Misc queries) 5 August 11th 08 09:39 PM
Browse For Folder start directory Todd Huttenstine Excel Programming 2 May 12th 04 02:24 PM
Directory Search cogent Excel Programming 2 May 5th 04 04:55 PM
How to get Active Directory Usergroup information Bert v.d. Brink Excel Programming 1 January 29th 04 03:24 PM
Directory search screen CLUPE Excel Programming 1 July 24th 03 09:41 PM


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