just wondering... have piece of code - macro in excel allows me open files in given directory. thing want open .xls files, , code have opens files in given directory.
can me matter.
thanks.
sub findopenfiles() dim fso scripting.filesystemobject, folder scripting.folder, file scripting.file, wb workbook dim directory string directory = "o:\test" set fso = createobject("scripting.filesystemobject") set folder = fso.getfolder(directory) each file in folder.files workbooks.open file next file end sub
sub findopenfiles() dim fso scripting.filesystemobject, folder scripting.folder, file scripting.file, wb workbook dim directory string directory = "o:\test" set fso = createobject("scripting.filesystemobject") set folder = fso.getfolder(directory) each file in folder.files if mid(file.name, instrrev(file.name, ".") + 1) = "xls" workbooks.open directory & application.pathseparator & file.name end if next file end sub
this woks fine...
Comments
Post a Comment