2015-12-22 89 views
0

我想寫這個數據到一個二進制文件在word中使用宏。 如果我運行此我得到這個錯誤「執行錯誤溢出(錯誤6)」上線認沽#handle,CByte( 「& H」 &輸出(I))vba二進制文件導致溢出

如何解決這個? 謝謝。

Sub HexStringToBinaryFile() 


    lol50 

    Dim output() As String 
    output = Split(lol, "|") 

    Dim handle As Long 
    handle = FreeFile 
    Open "C:\test.bin2" For Binary As #handle 

    Dim i As Long 
    For i = LBound(output) To UBound(output) 

     Put #handle, , CByte("&H" & output(i)) 

    Next i 

    Close #handle 

End Sub 
    Sub lol50() 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|01" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|02" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|03" 


End Sub 

回答

5

問題是您沒有在lol賦值行的末尾加上分隔符。所以當它們被分割時,前一行的最後兩位與下一行的前兩行連接。

該錯誤發生的位置:

lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|01" 
lol = lol & "00|00|00|00|00|00|00|00|40|00|00|00|00|00|00|00" 

當這個被解析時,有0100之間無分離器(下一行)所以0100值產生溢出。

|結束您的lol任務行中的每一個,並且錯誤應該消失。

1

Jason有正確的答案,但我不確定建立一個字符串,並拆分它以獲取數組是最好的方法。你可能會考慮直接填充一個數組。

Private lol(1 To 4656) As String 

Sub HexStringToBinaryFile() 

    Dim i As Long 
    Dim handle As Long 

    lol50 

    handle = FreeFile 
    Open "C:\test.bin2" For Binary As #handle 
     For i = LBound(lol) To UBound(lol) 
      Put #handle, , CByte("&H" & lol(i)) 
     Next i 
    Close #handle 

End Sub 
Sub lol50() 

    Dim i As Long 

    For i = 1 To 4656 
     lol(i) = "00" 
    Next i 

    For i = 9 To 4656 Step 16 
     lol(i) = "40" 
    Next i 

    lol(4000) = "01" 
    lol(4416) = "02" 
    lol(4656) = "03" 

End Sub