Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone have NT to test this? 1

Status
Not open for further replies.

andrew299

Technical User
Nov 18, 2002
140
GB
Hello
I have completed my macro!! Hoorah!! But I wrote it in windows 2000. When I went to run it on NT it didnt work properly.

can anyone try out this small bit of code to tell me if it does work on NT or not.

With fs
.LookIn = "C:\"
.SearchSubFolders = True
.MatchTextExactly = True
.filename = "extract4.exe"
.MatchTextExactly = True

If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then

i = 1
extract$ = .FoundFiles(i)

Else

MsgBox "The program Extract was not found"

End
End If



End With

What it does in 2000 is search the C:\ drive for a file called extract4.exe and the either tells you its not there or stores the location in the variable foundfiles(i). In NT it seems to just stick with the hourglass. Can anyone see the problem?
 
I dont think the problem is NT. I thought this originally because it didnt like coding for hyperlinks that worked in 2000. I think the problem is the search that I thought searched the whole c:\ drive only searches a small section such as the desktop. I have a line that searches sub folders but ecven this does not seem to do the job how do I change this?
 
OK problem solved remove the fs.propertytests part
+ look in c:\ bit
and it works fine
 
Thanks for posting your solution! You'll help someone else down the line :)
Rob
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top