if file is open save and close that file

  • Hi guys
    i am opening a text file via vba. I am struggling to check if the text file is already open or not, if its open can we save and close that file. if its not open then run some code. i tested the below code , even if file is open it says in the msg box that file is closed, i get the same message if file is closed(which is correct) .any help please


  • Try this Function to test if an error caused by opening the text file occurs.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!