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 intInFile and intFileNo.
It's possible that intFileNo is simply set to zero if you're not using the option explicit command, 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With