Shell Object Not Working Right In XL2000, But No Errors
I'm adding code to a workbook that will be used by Excel 2000 (on Win2K) and
Excel 2003 (on WinXP). The following code works fine in XL2003, but not in
XL2000.
Set objShell = CreateObject("Shell.Application")
Set objNS = objShell.Namespace(strFolderPath)
' Step through all the files in the current folder
For Each objF In objNS.Items
' GetDetailsOf exposes the summary information about the file. #12 is
the Category
If objNS.GetDetailsOf(objF, 12) = "myfile" Then
' Do stuff
End If
Next
When I step through the code in XL2000, I see that the objF objects are
recognized - I can hover the cursor over them and see the file/folder name as
the loop progresses. However, the statement "objNS.GetDetailsOf(objF, 12)"
returns a zero-length string in XL2000. In XL2003, it returns the "Category"
in the file's summary information. It does NOT, however, generate any error
messages in XL2000.
Is there something different I need to do for this code to work in XL2000?
--
Hmm...they have the Internet on COMPUTERS now!
|