excel vba - How to know if a txt file is already open with vba? -
i need open/create txt file excel vba, before opening file need make sure not open.
how can know if it's open, , if so, close before opening again ?
something :
if isopen(file_name) close(file_name) endif
unless want re-create same file scratch, if file tests open, why don't use it? if tests not open, open it. then, if doesn't exist create it.
you may clear out text file if open , want restart text instead of overwriting creating file again.
Comments
Post a Comment