excel - Determine if file exists -


i want open workbook variable in archive list.

if don't have file in archive, want show message box, did not work.

strvariable = left(pictureno, 4) d = "teknik resim arsiv listesi_" & strvariable & ".xls" dim ret ret = workbooks.open(thisworkbook.path & application.pathseparator & d)  if ret = false     msgbox "not found" end if 

check existence of file before attempting open it:

strvariable = left(pictureno, 4) d = "teknik resim arsiv listesi_" & strvariable & ".xls" if dir(thisworkbook.path & application.pathseparator & d) = ""     msgbox "not found" else     dim wb workbook     set wb = workbooks.open(thisworkbook.path & application.pathseparator & d) end if 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -