View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Randy Harmelink Randy  Harmelink is offline
external usenet poster
 
Posts: 122
Default Reading from a file

This worked fine for me when I added it to the code I sent previously:

Range("A1:B3") = vTest2

Was your "Dump" range the same dimensions (rows x columns) of what you
saved into the file, as well as your vTest array?

If the data was previously saved in a different matter, this method
won't work. You method of reading will need to be similar to your
method of writing.

On Mar 20, 8:19 pm, Ernst Guckel
wrote:
ok... My data file is text based for starters... This might matter... Also
Excel generated an error "Variable uses an automation type not supported in
Visual Basic"

Not sure... This is what I tried:

Dim strFileName As String
Dim vtest As Variant

strFileName = "C:\MenuItem.Dat"

Open strFileName For Binary As #1 ' Open file for input
Get #1, , vtest
Range("dump") = vtest
Close #1