Click here to Skip to main content
15,888,341 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Private Function ShowPic()
Dim bytedata() As Byte
Dim destfile As Integer
Dim file As String
Dim filelen As Long
Dim numlock As Integer
Dim leftover As Long
Dim i As Integer
Const blocksize = 100000

file = App.Path & "/mypic/Book1.xls"
       destfile = FreeFile
       Open file For Binary As destfile
       filelen = LOF(destfile)
numlock = filelen / blocksize
    leftover = filelen Mod blocksize
        bytedata() = RES(0).GetChunk(leftover)
            Put destfile, , bytedata()
    For i = 1 To numlock
        bytedata() = RES(0).GetChunk(blocksize)
        Put destfile, , bytedata()
    Next i

Close destfile
End Function


Error is:
Item cannot be found in requested name or ordinal........
bytedata() = RES(0).GetChunk(leftover)

Please help....
Posted
Updated 13-Feb-13 10:56am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900