Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Get bytes from file

I have been using a trick to get data from a binary file. The trick is
to initialize a variable as follows:

XXX=" "
Get #FileNum, 1, XXX

that gets 10 bytes from the file. I want, however to use the
option explicit
mode but as soon as I declare the variable
Dim XXX
I get a run time error
"Variable uses automation type not supported by visual basic"

but if I do not use the explicit option everything works.

I want to understand how to extract X bytes from the file, becase I
have a
section where I have strings and integers (I know the file format)

TIA
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Get bytes from file

How do you specify the string size ?
because with XXX=" "
it will fetch a 10 char string but what if later I want to fetch
a bigger size ? can you specify the size of the string on
declaration ?


Myrna Larson wrote in message . ..
Since you are setting it to a string of 10 characters, it must be a string,
no? So the statement should be

Dim XXX As String 'to fetch the strings
Dim i As Integer 'to fetch the integers


On 12 Oct 2004 18:31:40 -0700, (Luis Amezcua) wrote:

I have been using a trick to get data from a binary file. The trick is
to initialize a variable as follows:

XXX=" "
Get #FileNum, 1, XXX

that gets 10 bytes from the file. I want, however to use the
option explicit
mode but as soon as I declare the variable
Dim XXX
I get a run time error
"Variable uses automation type not supported by visual basic"

but if I do not use the explicit option everything works.

I want to understand how to extract X bytes from the file, becase I
have a
section where I have strings and integers (I know the file format)

TIA

Reply
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
0 bytes andy Excel Discussion (Misc queries) 6 May 9th 08 01:28 PM
How many bytes? GARY Excel Discussion (Misc queries) 0 April 15th 06 09:31 PM
file 0 bytes Lyndon Baysic via OfficeKB.com Excel Discussion (Misc queries) 2 May 7th 05 12:47 PM
How to get the size of the excel file, a sheet size (in bytes)? bookworm98[_13_] Excel Programming 1 January 28th 04 02:59 PM
File with too Bytes? Pier Excel Programming 1 July 26th 03 03:28 AM


All times are GMT +1. The time now is 09:02 AM.

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

About Us

"It's about Microsoft Excel"