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
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.
This is VBA inside of a Proficy iFix graphic, and can’t for the life of me figure out what I am doing wrong.
You’re mixing up
intInFileandintFileNo.It’s possible that
intFileNois simply set to zero if you’re not using theoption explicitcommand, which may explain the invalid number.That little command goes at the top of every one of my VB/VBA files because I’ve been burnt by this so many time before.