Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Filesearch for hidden files

Hi all

As part of a macro I have written, I am doing a filesearch to check that a
template file exists before trying to open it. However, I cannot get it to
work in that it always returns 0. I have tried finding files other than the
one I want and it seems to work fine so I know my code is OK. This led me to
conclude that there must be soehting about this particular file so I re-ran
the code from the root (C:\) gradually adding directories for my chosen path
each time to try and work out where the problem was. The code stopped
finding files after I added a directory which I discovered was hidden. Am I
correct in assuming that the filesearch class does not search hidden
directories/files and if so is there any way of getting it to do so? There
doesn't seem to be anything relating to this in the Excel Help files.

Thanks
Andy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Filesearch for hidden files

Hi Andy,

There are many reported problems with Filesearch.

See:

http://tinyurl.com/3gwog


---
Regards,
Norman



"Andy" wrote in message
...
Hi all

As part of a macro I have written, I am doing a filesearch to check that a
template file exists before trying to open it. However, I cannot get it
to
work in that it always returns 0. I have tried finding files other than
the
one I want and it seems to work fine so I know my code is OK. This led me
to
conclude that there must be soehting about this particular file so I
re-ran
the code from the root (C:\) gradually adding directories for my chosen
path
each time to try and work out where the problem was. The code stopped
finding files after I added a directory which I discovered was hidden. Am
I
correct in assuming that the filesearch class does not search hidden
directories/files and if so is there any way of getting it to do so?
There
doesn't seem to be anything relating to this in the Excel Help files.

Thanks
Andy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Filesearch for hidden files

Andy,
A lot of people seem to have problems with the Office.Filesearch and its
erratic behaviour.
many advise to drop it use VB/VBA Dir() function instead.

NickHK

"Andy" wrote in message
...
Hi all

As part of a macro I have written, I am doing a filesearch to check that a
template file exists before trying to open it. However, I cannot get it

to
work in that it always returns 0. I have tried finding files other than

the
one I want and it seems to work fine so I know my code is OK. This led me

to
conclude that there must be soehting about this particular file so I

re-ran
the code from the root (C:\) gradually adding directories for my chosen

path
each time to try and work out where the problem was. The code stopped
finding files after I added a directory which I discovered was hidden. Am

I
correct in assuming that the filesearch class does not search hidden
directories/files and if so is there any way of getting it to do so?

There
doesn't seem to be anything relating to this in the Excel Help files.

Thanks
Andy



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Filesearch for hidden files

Thanks Norman (and Nick)

Fixing the problem isn't really an option since the macro will ultimately be
used on mutiple machines - presumably it wasn't fixed in SP2 then?

I guess that leaves me with putting an error trap round the statement that
attempts to open the file if it doesn't exist. I'll also have a go with the
Dir function.

Thanks
Andy

"Norman Jones" wrote:

Hi Andy,

There are many reported problems with Filesearch.

See:

http://tinyurl.com/3gwog


---
Regards,
Norman



"Andy" wrote in message
...
Hi all

As part of a macro I have written, I am doing a filesearch to check that a
template file exists before trying to open it. However, I cannot get it
to
work in that it always returns 0. I have tried finding files other than
the
one I want and it seems to work fine so I know my code is OK. This led me
to
conclude that there must be soehting about this particular file so I
re-ran
the code from the root (C:\) gradually adding directories for my chosen
path
each time to try and work out where the problem was. The code stopped
finding files after I added a directory which I discovered was hidden. Am
I
correct in assuming that the filesearch class does not search hidden
directories/files and if so is there any way of getting it to do so?
There
doesn't seem to be anything relating to this in the Excel Help files.

Thanks
Andy




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
filesearch not finding files Kevin Excel Programming 1 January 18th 05 01:49 PM
FileSearch dislikes Zip-files Hub van de Laar Excel Programming 4 September 1st 03 08:50 PM
FileSearch doesn't find zip files Hub van de Laar Excel Programming 3 September 1st 03 07:43 PM
FileSearch dislikes Zip-files Hub van de Laar Excel Programming 0 September 1st 03 06:53 PM
FileSearch dislikes Zip-files Hub van de Laar Excel Programming 0 September 1st 03 06:52 PM


All times are GMT +1. The time now is 02:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"