Hello,
I've migrated from Windows XP/Office 2003 to Windows Vista/Office 2010.
Everything works fine exept of my old macros. They have beed programmed... probably at 1997? But they worked just fine, till now.
I read on the web that it is because of some incompatibilities since Office 2007. But can you please tell me WHAT EXACTLY needs to be updated in my code?
Attachment 321592
lblNew = "Name of the new list is : " & newname
list = newname
lblSelect.Top = 66
lblSelect.Visible = True
cboSelect.Top = 66
cboSelect.Visible = True
' fill file list
With Application.FileSearch
.NewSearch
' change this to the requested file folder
.LookIn = "C:\Mouse"
.SearchSubFolders = False
' .Filename = "Mouse*.xls"
.FileType = msoFileTypeExcelWorkbooks
cboSelect.ColumnWidths = 0
If .Execute > 0 Then
For ii = 1 To .FoundFiles.Count
poz = 0
i = 0
Do
If Mid(.FoundFiles(ii), Len(.FoundFiles(ii)) - i, 1) = "\" Then
poz = Len(.FoundFiles(ii)) - i
End If
i = i + 1
Loop Until Not poz = 0 Or i = Len(.FoundFiles(ii))
file_name = Mid(.FoundFiles(ii), poz + 1)
cboSelect.AddItem .FoundFiles(ii)
cboSelect.list(ii - 1, 1) = nazev_soub
Next
Else
cboSelect.Visible = False
lblSelect.Font.Italic = False
lblSelect.Font.Bold = True
lblSelect.Font.Size = 9
lblSelect.BackColor = &HFF&
lblSelect.TextAlign = fmTextAlignCenter
lblSelect = "There is no file named Mouse*.xls in folder C:\Mouse"
End If
End With
storno = 2
End If
End If
End If
What I need is to scan folder C:\Mouse and there find .xls file (Mouse.xls) which will apear in ComboBox (via attached screenshot).
Something wrong with .LookIn command?
Thank you
Vardenf
Bookmarks