Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Saving a collection to an external file

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Saving a collection to an external file

I guess your right. I decided on populating the collection and exporting it
to an XML file. Since each workbook (and worksheets) are different the
populate collection, export to XML, read from XML and repopulate all have to
be custom. However there are opportunities to make some "generic" support
functions which reduces work and errors (when I get all the bugs out...).

- Pat

"Joel" wrote:

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

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
Import External Data: Saving changes to the database Jean Excel Discussion (Misc queries) 1 April 8th 07 11:12 PM
Problems with saving WorkSheets that have External Links No Name Excel Programming 2 July 7th 06 07:27 PM
Saving Large .xls file to external drives iumike2004 Excel Discussion (Misc queries) 2 March 10th 06 05:01 PM
Saving an external file without making it active JENNA Excel Programming 2 January 17th 04 11:51 PM
External data queries within applcation collection Andy S Excel Programming 2 November 24th 03 08:44 PM


All times are GMT +1. The time now is 06:39 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"