excel vba - VBA Open file with wildcard knowing only extension -
i trying excel open file in given folder (thisworkbook.path\peach\apple)
has .xlsm extension (there 1 file). possible open wildcard character? not know name of file, extension.
if not, there way it?
just ask file system first matching file:
dim path string: path = thisworkbook.path & "\peach\apple\" findfirstfile = dir$(path & "*.xlsm") if (findfirstfile <> "") workbooks.open path & findfirstfile else '// not found end if
(this not search sub-directories)
Comments
Post a Comment