title: VBA write to text file: Run-time error 52 'bad file name or number'
body: <pre><code>Public Sub EdgeColor_Click()
      Dim intInFile As Integer
      intInFile = FreeFile
  
      Open "c:\picturename.csv" For Output As #intFileNo
      Print #intFileNo, "test"
  
      Close #intFileNo
  End Sub
  </code></pre>
  
  <p>This is my code, and I get Run-time error 52 'bad file name or number'. I've tried doing as Input and making the file exist but I get the same error.</p>
  
  <p>This is VBA inside of a Proficy iFix graphic, and can't for the life of me figure out what I am doing wrong.</p>