Results 1 to 7 of 7

Thread: [RESOLVED] Run Time Error 70, premission denied with ResToFile? Why is this!?

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2009
    Location
    Missouri
    Posts
    770

    Resolved [RESOLVED] Run Time Error 70, premission denied with ResToFile? Why is this!?

    Here is the code i am using for put a resource(music) to a file.

    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
    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?


    EDIT: XD I got it. Added Kill then the only file that was giving me that problem. =P
    Last edited by Gamemaster1494; May 29th, 2010 at 05:47 PM. Reason: fixed it
    Rate my post if i helped you!


    Button Configuration Control For VB6 GetAsyncKeyState
    I'm the 7th best high school programmer in the nation!(according to SkillsUSA Nationals)(Used C#.Net)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width