Here is the code i am using for put a resource(music) to a file.
I have run it like 4 times, and it has worked before. Idk why its saying this now. It highlighted the text above that is in blue, and i checked the path and there was a file there.... Why is it giving me this error, and how can i fix it?Code:Public Sub ResToFile(FileName As String, ResID As Variant, ResType As Variant, Optional overwrite As Boolean = True) Dim Buffer() As Byte Dim Filenum As Integer If Dir(FileName) <> Empty Then 'Check if output file already exists If overwrite Then Kill FileName Else Err.Raise 58 End If Buffer = LoadResData(ResID, ResType) 'Load the resource into a byte array Filenum = FreeFile Open FileName For Binary Access Write As Filenum Put Filenum, , Buffer 'Write the entire array into the file Close Filenum End Sub
EDIT: XD I got it. Added Kill then the only file that was giving me that problem. =P




Reply With Quote