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



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 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.

============================

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

.



Relevant Pages

  • Re: WHY
    ... As for higher dimensions, I'd prefer to write my tensors in Mathematica ... I don't use 3D arrays much in Excel. ... Multiple dimensions aren't often needed or even useful, ...
    (microsoft.public.excel)
  • Re: Excel Chart Series Values Property Size Limitation
    ... The more you learn about Excel, the more you feel this way. ... "Peter T" wrote: ... I only mentioned Named arrays as you had asked if was possible to hold ... 'large' series data not in cells. ...
    (microsoft.public.excel.charting)
  • Re: Fastest way to read data to populate combo controls?
    ... dumping the whole thing into a CSV and parse it using VB. ... When you talk about using a CSV, Ralph, I have no clue how VB would ... The Excel macro creates a Word document with six tables: ... arrays, then writes these arrays into combos. ...
    (microsoft.public.vb.general.discussion)
  • Re: Excel 2003 - Logical Expressions
    ... > Both TC and WB001B are named arrays - But when they are entered by ... > single element from the same row of the array to the formula. ... > When you enter theose names in the AND function, Excel processes the two ... >> I have a table with several named columns and the cells in the columns ...
    (microsoft.public.excel)
  • Re: Array Nomenclature
    ... except I do a lot of further manipulations on the arrays before dumping to Excel. ... I use Excel for reporting a lot of the time, recordset> variant> transpose> dump to Excel. ... myVaris first row, first field of RecSet myVaris second row, first field of RecSet ...
    (microsoft.public.vb.general.discussion)