excel files not recognised as such after rename

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I have the followinbg code in a procedure:

Dim sPath As String
Dim i As Integer
Dim wkbk As Workbook

sPath = "C:\FileFolder"

With Application.FileSearch
.NewSearch
.LookIn = sPath
.SearchSubFolders = False
.Filename = "*.xls"
.FileType = msoFileTypeExcelWorkbooks

If .Execute() > 0 Then

For i = 1 To .FoundFiles.Count

etc etc


I have just renamed all the files manually and the code has ceased to
recognise them as excel workbooks.

If I right click and look at properties it says they are excel workbooks. I
have files with the same names as the previous ones in another folder and
they are, so I know it is the renaming. The files didn't explicitly have
..xls suffixes which I removed so does anyone know why they have suddenly
become unrecognised and how I can remedy it?

Any help much appreciated.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top