Re: Fastest way to read data to populate combo controls?
- From: Ed from AZ <prof_ofwhat@xxxxxxxxx>
- Date: Wed, 17 Sep 2008 09:52:34 -0700 (PDT)
Apologies to Ralph and Lorin for the confusion! I assure you it is
not limited to names!
The data is simply text strings. I use a four-column layout in Excel:
-- doc title
-- full path
-- comment 1
-- comment 2
The Excel macro iterates through the used range in Excel and, based on
a designator (F or S) in a fifth column that doesn't get into the
arrays, writes the data into one of six arrays: three F arrays and
three S arrays, with one array of each set having the title and path,
another with comment 1 and path, and the third with comment 2 and
path. Then the macro creates a Word doc, creates a table for each
array, and writes the array info into the table.
When the VB app opens, the Form.Load opens the WOrd doc, goes through
the tables and re-creates the arrays, then writes these arrays into
combo controls.
Ed
On Sep 17, 7:49 am, "Ralph" <nt_consultin...@xxxxxxxxx> wrote:
"Ed from AZ" <prof_ofw...@xxxxxxxxx> wrote in messagenews:f61c5ea6-bbb8-4c32-b148-de4bf2ae17b9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, Ralph.
Why not simply write the Excel data to a .csv or .tsv (tab) then read into
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.
============================
You meant Lorin not Ralph.
Office products can be used together in mulitple ways allowing one to build
some amazing solutions, but this interoperability has never been considered
'fast'. So what Lorin was pointing out is that you could easily skip the
"Word Data List" entirely. Which would speed up the process as well as
simplifying it.
A .csv file is a flat file that contains data separated by commas, and rows
separated by a carriage return, eg:
"John","Brown",21,...,...
"Billy","Black",34,...,...
A .tsv file is a flat file that contains data separated by tabs, and rows
separated by a carriage return, eg:
"John"[TAB]"Brown"[TAB]21[TAB]...[TAB]...[TAB]
"Billy"[TAB]"Black"[TAB]34[TAB]...[TAB]...
The quotes are optional - sometimes included to indicate the value is a
string.
You can create these files directly from Excel [Data Export] manually, or by
using a Macro.
VB can read these flat files far faster than it takes to create and read a
Word Data List. In one gulp and deliver the data as an array to be mined.
If you provide Lorin with an example of what your data looks like, and what
goes into what array. He or someone else can show you exactly how to do it.
-ralph
.
- Follow-Ups:
- References:
- Fastest way to read data to populate combo controls?
- From: Ed from AZ
- RE: Fastest way to read data to populate combo controls?
- From: Lorin
- Re: Fastest way to read data to populate combo controls?
- From: Ed from AZ
- Re: Fastest way to read data to populate combo controls?
- From: Ralph
- Fastest way to read data to populate combo controls?
- Prev by Date: Re: Opening statement to end code if condition occurs
- Next by Date: Re: Opening statement to end code if condition occurs
- Previous by thread: Re: Fastest way to read data to populate combo controls?
- Next by thread: Re: Fastest way to read data to populate combo controls?
- Index(es):
Relevant Pages
|