View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Saving a collection to an external file

A collection is really a array of data structures in memory. If this was C
language and there wre no points in the sturctures you could save the
continous memory locations as binary data to a file. Then read the file back.

Basic doesn't allow you the access the same way C language does. Through
language extension you can access DLL using the C Language structures so I
guess it may be possible. the problem is there isn't a nice command to get
the size of the structure like in clanguage sizeof(Mystructure) to get the
byte count and there isn't any easy way of reading and writing the binary
data.


The easier approach would be to create CSV file of the data in the
structure. Write a routine to dump the structure and another to upload the
structure.

"Dreiding" wrote:

I'm looking to see if someone has developed an approach to reading and
writing a 'collection' to an external file. Perhaps a 'cookie'?
Any suggestions and thoughts on this topic appreciated.
This is all from within VBA. The collection is not data on a worksheet.
I suspect XML would work, only if I knew how. Can you give me some pointers?
Thanks,
- Pat