Link to home
Start Free TrialLog in
Avatar of uad
uadFlag for United States of America

asked on

Saving multi-dimensional array to file and reloading at a later time

I have an excel (Excel 2010) macro that creates a multi-dimensional array from multiple excel files to generate individual reports.

Rather than reloading the array every time the reports are being tested/vetted, is there a way to save the data from the multi-dimensional array into a file  and reload the array from this file rather than recreating the array from the original data files every time?  If so, how would this be done using Excel?
Avatar of omgang
omgang
Flag of United States of America image

First thing that comes to mind it to output the array contents to a delimited text file.
How many dimensions is the array?  Are you able to provide some sample data?
OM Gang
Avatar of uad

ASKER

The array is dimensions (6,000 , 55, 4).

Due to the nature of the data, unable to post a sample of the data.

Based on your suggestion of output to a delimited text file, are you suggesting a single text file for the depth - 4 for this example.  In other words 4 files each with the equivalent of 6000 rows and 55 columns?
SOLUTION
Avatar of omgang
omgang
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of uad

ASKER

As what happens in most cases, this was supposed to be a one and done - but, that isn't how it turned out . . . yes, access would be the way to go if there was time permitting to recreate everything in access, which there isn't.

As to the format yes, most of the 55 elements per individual row, could have up to 4 separate values.  A simple want to grasp the array would be:  a person (1 to 6000) and item (1 to 55) and value for each item (e.g. 4 yrs)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Alexey Kudinov claims to show

How to serialize objects in VBA

It's a very general method and the XML file generated may be larger and slower than the method you already have.
Avatar of uad

ASKER

Shared point - one gave me the concept to approach this issue, the other gave me basic code to follow
I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015