Results 1 to 4 of 4

Thread: Reading/Saving binary data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member
    Join Date
    Apr 2011
    Posts
    190
    Rep Power
    14

    Reading/Saving binary data

    Below is my code (somehow the code tags are gone - so sorry-cannot post using code tags). I open the source file(#2) as a binary file and the destination file (#1) for random access. Next I do some large loops reading 4 byte single values from the source file and then save them in the destination file - for every oberservation (iix) - I have 1100 values each 4 bytes to read. As you can see the 1100 values that I read for each of the iix loop is consequtive - so is there a way I read the 1100 byte single values in a single operation and also store them in a single operation. The current loop is quite slow.

    Code:
    For iix = 0 To 20000
            AAXdouble = ThisWorkbook.Worksheets("TempSample").Cells(iix, ColSpectraPosition)
            For iiix = 0 To 9999
                Get #2, Adouble, Asingle
                Put #1, AXdouble, Asingle
                Adouble = Adouble + 4
                AXdouble = AXdouble + 4
            Next iiix
     Next iix
    Last edited by Excel Fox; 02-25-2012 at 11:47 PM. Reason: Code Tags
    xl2007 - Windows 7
    xl hates the 255 number

Similar Threads

  1. Saving and Running Macro For Multiple Files / Users
    By Charles_ in forum Excel Help
    Replies: 1
    Last Post: 01-07-2013, 09:10 AM
  2. Message Box Before Saving Document
    By Lucero in forum Excel Help
    Replies: 2
    Last Post: 04-15-2012, 07:09 AM
  3. Reading Access tables using INNER JOIN
    By Rasm in forum Excel Help
    Replies: 2
    Last Post: 02-04-2012, 09:17 PM
  4. Saving Embedded Picture From Excel Workbook Sheet To Folder Hard Drive
    By littleiitin in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 10-31-2011, 02:31 PM

Posting Permissions

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