gmaxey
08-25-2012, 07:56 AM
Can anyone explain why the second function won't point to the folder passed? Thanks.
Sub Test()
MsgBox GetFolder
MsgBox GetFolderWithPointer("C:\Program Files")
End Sub
Function GetFolder()
Dim oFolder As Object
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Demo", 0, "C:\Program Files")
GetFolder = oFolder.self.Path
End Function
Function GetFolderWithPointer(Optional Pointer As String = "")
Dim oFolder As Object
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Demo", 0, Pointer)
GetFolderWithPointer = oFolder.self.Path
End Function
Sub Test()
MsgBox GetFolder
MsgBox GetFolderWithPointer("C:\Program Files")
End Sub
Function GetFolder()
Dim oFolder As Object
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Demo", 0, "C:\Program Files")
GetFolder = oFolder.self.Path
End Function
Function GetFolderWithPointer(Optional Pointer As String = "")
Dim oFolder As Object
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Demo", 0, Pointer)
GetFolderWithPointer = oFolder.self.Path
End Function