excel vba - VBA - using a wild card in filename to avoid processing a file -


i looping though number of directories in vba , trying avoid processing 1 file in each directory. first 2 letters of filename changes depending on directory searching. example in 1 directory file called ee-help-me.xlsx , in called f-help-me.xlsx. have tried use wildcard *-help-me have done wrong file processed. have @ code , let me know how fix please?

my code is:

sub listfiles(fld object, mask string) dim fl object 'file each fl in fld.files     if fl.name mask     'open , interrogate file here         if fl.name <> "*-help-me.xlsx" '<<-- not catching when offending file present             debug.print fld.path & "\" & fl.name             'do        end if       end if next end sub 

many thanks

try:

if not fl.name "*-help-me.xlsx" 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -