Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Friend,
Thank you very much for your reply. It perfectly works for me. Thanks again. Have a nice time. Sri Gary''s Student wrote: For the folder browser: Private Const BIF_RETURNFSANCESTORS As Long = &H8 Private Const BIF_BROWSEFORCOMPUTER As Long = &H1000 Private Const BIF_BROWSEFORPRINTER As Long = &H2000 Private Const BIF_BROWSEINCLUDEFILES As Long = &H4000 Private Const MAX_PATH As Long = 260 Function BrowseFolder(Optional Caption As String, _ Optional InitialFolder As String) As String Dim SH As Shell32.Shell Dim F As Shell32.Folder Set SH = New Shell32.Shell Set F = SH.BrowseForFolder(0&, Caption, BIF_RETURNONLYFSDIRS, InitialFolder) If Not F Is Nothing Then BrowseFolder = F.Items.Item.Path ' F.Items.Item.InvokeVerb End If End Function Sub Display_Folder() Dim FName As String FName = BrowseFolder(Caption:="Select A Folder", InitialFolder:="C:\MyFolder") If FName = vbNullString Then MsgBox ("No folder selected.") Else MsgBox ("Folder Selected: " & FName) End If End Sub Must first set a reference to Microsoft Shell Controls and Automation. For the DIR: Sub Macro1() x = Shell("cmd.exe /c dir /s files.xls", 1) End Sub Hello all, [quoted text clipped - 17 lines] Thanks Sri -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200810/1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trying to browse Add-ins???? | Excel Discussion (Misc queries) | |||
View cell contents as a pop-up window (similar to comments window) | Excel Worksheet Functions | |||
Docking Project Explorer, Properties window and Code window in VBE | Setting up and Configuration of Excel | |||
The window opens in a smaller window not full sized window. | Excel Discussion (Misc queries) | |||
Excel 2003 Viewer: No more "Browse in same window" IE functionality? | Excel Discussion (Misc queries) |