Re: Fastest way to read data to populate combo controls?



Hi, Ralph.

Why not simply write the Excel data to a .csv or .tsv (tab) then read in to
VB app.

I'm not understanding you, probably because I've never tried to do
anything like that before.

I keep a "master list" of the Word docs and their attributes in the
Excel file and maintain it at my leisure. When I'm done making
changes to it, I run the Excel macro to create my "data list" (Word
doc with tables) for the VB app to read when I run the app. That may
be hours or even days later - the VB app never touched the Excel file.

I can understand how to tell VB to go to this table and iterate
through the rows, putting the text in Cell(x,1) into ArrayA(x,1), and
Cell(x,2) into ArrayA(x,2). I've never worked with a .csv or .tsv
data file before.

Ed

What are the data types?

Everything is a string.



On Sep 15, 5:25 pm, Lorin <Lo...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
If I follow you..
Why not simply write the Excel data to a .csv or .tsv (tab) then read in to
VB app.
That would be the fastest since no objects would be involved.
If you write the Excel macro correctly you could read the data files in two
file gets it the data types support.  i.e. get the number of types, resize
the type array the read all in one get.  One pass for each set of data files.
 What are the data types?

Or Using VBA in Excel?  I think that it writes variants.  And reading a
variant array into VB is also fast.



"Ed from AZ" wrote:
When my VB6 app opens, the Form.Load code opens a document, reads the
info into six arrays, and then uses these arrays to populate six
combobox controls.  The info in question are "attributes" assigned to
a folder of Word documents; through the combos, I select an attribute
and the VB app opens that document.

At the moment I'm using a Word document to hold the info, because I
have the info in separate tables and I can iterate through the Tables
collection to make sure the info gets into the correct array.  I close
the doc, but keep the Word app object because I will use it later.

The Word doc is actually built using a macro in an Excel file.  I
thought about just reading the Excel file on open and skipping the
Word doc, but I don't know if it would save any time when I open the
VB app (the Excel file and Word list doc are maintained during times
the VB app is not in use).  I would save myself the extra step of
building the Word list file, but since it's a macro there's not real
time lost.

Another possibility would be to write the attributes to each Word doc
as CustomVariables, and iterate through the files reading these
variables into the arrays.

It doesn't take forever to open the app now, but there is a noticable
pause between launch and form open.  If using the Excel file or Custom
Variables would reduce the pause, I'd like that.

Ed- Hide quoted text -

- Show quoted text -

.