[XL2000] ObjFolder.Self.Path - 438 error

G

Guest

In XL2000 i am receiving a 438 'object doesn't support this property / method
error on the line 'Foldername = oFolder.Self.Path'. I have tried without the
"Self" as it doesn't appear to be supported in Xl2000, but the error
persists. My test environment is Win98 | XL2000 - but the error was reported
on a system apparently running WinXP | XL2000. Any pointers appreciated...

Function ChooseFolder()
Dim oApp As Object
Dim oFolder As Object
Dim FolderName As String

Set oApp = CreateObject("Shell.Application")
Set oFolder = oApp.BrowseForFolder(0, "Choose Folder", 512)
If Not oFolder Is Nothing Then
FolderName = oFolder.Self.Path
If Right(FolderName, 1) <> "\" Then
FolderName = FolderName & "\"
End If
ChooseFolder = FolderName
End If
End Function
 
J

Jim Cone

Try...

FolderName = oFolder.items.Item.Path
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Mike Iacovou"
<[email protected]>
wrote in message
In XL2000 i am receiving a 438 'object doesn't support this property / method
error on the line 'Foldername = oFolder.Self.Path'. I have tried without the
"Self" as it doesn't appear to be supported in Xl2000, but the error
persists. My test environment is Win98 | XL2000 - but the error was reported
on a system apparently running WinXP | XL2000. Any pointers appreciated...

Function ChooseFolder()
Dim oApp As Object
Dim oFolder As Object
Dim FolderName As String

Set oApp = CreateObject("Shell.Application")
Set oFolder = oApp.BrowseForFolder(0, "Choose Folder", 512)
If Not oFolder Is Nothing Then
FolderName = oFolder.Self.Path
If Right(FolderName, 1) <> "\" Then
FolderName = FolderName & "\"
End If
ChooseFolder = FolderName
End If
End Function
 
G

Guest

thanks Jim. works ok... had just found a compatible API call on j-walk, but
this mod will work very nicely.
many many thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top