LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Speeding up the importing of data from file

I am using the following to import binary data from a file and convert
to hexadecimal. Is there a different way to do this that would be
faster? I got list help last year to speed up my checksum routine by
putting the data into a variant array. I was able to also us it for
saving to a file too. I need some of the same magic importing data
from a file. File size can be over a meg in size and is taking minutes
to load.
__________________________________________________ ___

Dim fs, f, ts, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(FileNameWithPath)
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
ColumnCount = 3
RowCount = 1
Do While ts.atendofstream = False 'Loop to fill column with HEX
numbers
DecimalByte = Asc(ts.Read(1))
HexByte = Hex(DecimalByte)
Cells(RowCount, ColumnCount) = HexByte
RowCount = RowCount + 1
Loop
ts.Close
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Speeding up the importing of data from file Fan924 Excel Programming 1 January 24th 10 01:59 AM
importing data from a txt file rrlogan Excel Worksheet Functions 1 May 15th 09 07:37 PM
Importing data file Mohit Excel Discussion (Misc queries) 1 June 1st 06 07:45 PM
importing data from txt file onelson Excel Discussion (Misc queries) 0 August 2nd 05 02:24 PM
Importing Data from another Excel File Pasha Excel Programming 1 January 25th 04 12:04 PM


All times are GMT +1. The time now is 07:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"