View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Disgarding lnk files

.filename like "*.lnk"

to demonstrate from the immediate window:

sStr = "C:\My folder\My File.lnk"

? sStr like "*.lnk"
True
sStr = "C:\My folder\My File.xls"
? sStr like "*.lnk"
False


--
Regards,
Tom Ogilvy


"Les" wrote in message
...
Hello.

I am writing some VBA in excel which auto-archives files in a set of
folders/subfolders. All's going well, other than when the
application.filesearch command encounters a shortcut, it tries to archive

the
file the shortcut points to.

I need to isolate the .lnk files to disregard them.

I've tried to isolate the shortcuts using '.filename = "*.lnk"', but to no
avail.

Could anyone please tell me how to isolate them?

Thanks in advance.