VBA Name write InUse_YES.txt to a folder using Const FileControlFolder

  • MODERATOR NOTICE: This topic has also been posted on other sites and may already have an answer elsewhere. Please take this into consideration when answering this question

    Morning All,

    First time user first time question.

    I have a workbook where when a user opens it the code below should write over InUse_No.txt to InUse_YES.txt

    Name FileControlFolder & FileControlSubFolder & "\InUse_NO.txt" As FileControlFolder & FileControlSubFolder & "\InUse_YES.txt"

    I use:

    Option Explicit

    Const FileControlFolder = "H:\PROJECT-OPS\MultipleUsersIssue\FilesInUse\"

    Dim FileControlSubFolder As String

    Which predefines the folder where FilesInUse is

    There is already InUse_NO.txt already in the folder FilesInUse but when I open it there is an error Run-time error 53 File not found - Which quite annoying!

    I attach 2 workbooks with simular code. I was mucking around to see if Im missing something but no avail

    Steven Behr