Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
http://www.justlottery.com/dwnld/INDSuperlotto.rtl
http://www.justlottery.com/dwnld/INDThunderball.rtl http://www.justlottery.com/dwnld/INDFast.rtl Can anybody help reading the above three binary file in excel through a vba? The following macro reads the first file but not through Excel VBA, it reads to Visual Basic. Can anybody understand the logic of the below code and convert into Excel macro? Option Explicit Private Type TREC No As Integer D As Integer M As Integer Y As Integer Numbers(1 To 10) As Integer End Type Private Sub Command1_Click() Const Fle$ = "c:\t\t.rtl" Dim B(1 To 28) As Byte Dim Channel%, L9&, L8&, Max& Dim Rec As TREC Me.Cls Channel = FreeFile Open Fle For Binary Access Read As Channel ' Get 4 byte header - No of lines Get #Channel, 1, Max& Me.Print Max ' --- Now the 28 byte records For L9 = 1 To 10 Get #Channel, , Rec Disp Rec.No Disp Rec.D Disp Rec.M Me.CurrentX = Me.CurrentX + TextWidth("XX") Disp Rec.Y For L8 = 1 To 10 Disp Rec.Numbers(L8) Next Me.Print "" Next Close #Channel End Sub Private Sub Disp(N%) Dim S$ S$ = Trim$(N) Me.CurrentX = Me.CurrentX + TextWidth("XXX") _ - TextWidth(S$) Me.Print S$; End Sub Private Sub Form_Load() Me.AutoRedraw = True Me.Width = Screen.Width * 0.75 End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Solver returns non binary answer in binary constrained cells | Excel Worksheet Functions | |||
Binary operations (left/right shift, binary and/or, etc.) | Excel Programming | |||
read a Unix binary file | Excel Programming | |||
Help reading binary file | Excel Programming | |||
Excel binary file format | Excel Programming |