ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disgarding lnk files (https://www.excelbanter.com/excel-programming/343759-disgarding-lnk-files.html)

Les

Disgarding lnk files
 
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.

ilyaskazi[_97_]

Disgarding lnk files
 

Have u tried this:


Code
-------------------
.FileType = msoFileTypeExcelWorkbook
-------------------

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=47905


Tom Ogilvy

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.





All times are GMT +1. The time now is 06:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com