View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default FileSearch.Execute does not find *.eml or *.lnk files

RosH,
By the way, normally it is not necessary to .Select objects in Excel, unless
you have a reason to do so.
e.g.
With ActiveSheet
.Hyperlinks.Add Anchor:=.Range("FirstCell").Offset(nCounter , 0)....
End With

NickHK

"RosH" wrote in message
oups.com...
Thanks NickHK,
I used Dir() and the macro is working fine now. Just a little
changes as given below made my macro so simple. Once again thankx.

sFirstFile = Dir(sLookfor, vbNormal)

Do Until sFirstFile = ""
nCounter = nCounter + 1
Selection.Offset(1, 0).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=sLookin &
"\" & sFirstFile, _
TextToDisplay:=sFirstFile
sFirstFile = Dir()
Loop

Range("B2").Value = nCounter