Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MDW MDW is offline
external usenet poster
 
Posts: 117
Default 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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Shell Object Not Working Right In XL2000, But No Errors

Not sure what the problem is, but as these are not Excel's objects, any
difference is probably down to the OS
For my W2K, I get valid responses for indices 0-8, all higher values
returning Empty.
It would appear that info such as "Category" cannot be returned from a
folder like this.
Have you looked in "Streams" ?

NickHK

"MDW" wrote in message
...
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!



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
Shell command in VBA suddenly stops working Ian Parker[_3_] Excel Programming 3 May 1st 12 03:54 PM
XL2000 stock price web query stopped working Matthew Guerreiro Excel Discussion (Misc queries) 13 May 30th 06 04:16 PM
Macro created in XL2000 not working in XL97 Shetty Excel Programming 6 May 27th 04 03:01 PM
WindowStyle not working in shell command KLC Excel Programming 1 November 10th 03 10:10 PM
XL2000: Shape object events GSQUARED Excel Programming 1 October 22nd 03 05:15 PM


All times are GMT +1. The time now is 04:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"