vba - IsFileOpen() NeverSees File as Open? -
in vba (from ms access) trying determine if xls file open calling following function, sending full path , filename:
function isfileopen(filename string) dim ff long, errno long on error resume next ff = freefile() open filename input lock read #ff close ff errno = err on error goto 0 select case errno case 0: isfileopen = false case 70: isfileopen = true case 53: isfileopen = false ' file not found case else: error errno end select end function
this routine ever returns (0) - file closed - regardless of status of file in question. have confirmed path , filename correct, constructed in access follows:
strpath = left(currentdb.name, instrrev(currentdb.name, "\")) myfile = strpath & myinvid & "changetemplate.xlsx"
any thoughts might missing here?
thanks!
argh! xls being saved accessmode := xlshared
the file passed lock test routine.
<< topic closed >>
Comments
Post a Comment