Hi Ryan
I use this code (or, rather, code that builds on this basic idea)
extensively. I find it works reliably 100% of the time -- but only if
there are no glitches in the data.
If the are problems in the data (eg, a string where there should be a
number, or some strange characters or something like that) then the DAO
will just stop picking up any data after the problem.
To diagnose the problem, have a look at the recordset using the Locals
window. Try to identify the last piece of data that was correctly read.
The problem is almost certainly with it, or with the next piece of data.
In any case, for professional work, you would need to add appropriate
diagnostics and error checking to the sample code provided.
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
>I am wondering how stable this code is:
> http://word.mvps.org/FAQs/InterDev/FillListBoxFromXLDAO.htm
[quoted text clipped - 23 lines]
> Regards,
> Ryan--
ryguy7272 - 14 Dec 2007 15:07 GMT
When a problem occurs, the VBE opens and 'UserForm1.Show' is highlighted
yellow. The Locals Windows shows AutoNew (my sub) and under Value, the
message reads <No Variables>. It seems like it is getting stuck reading the
very first piece of data.
I'm trying to ensure data integrity on the Excel side. I'm going to try to
look into this today, if time permits. By the way Shauna, what would those
'appropriate diagnostics' be?
Regards,
Ryan---

Signature
RyGuy
> Hi Ryan
>
[quoted text clipped - 45 lines]
> > Regards,
> > Ryan--
ryguy7272 - 18 Dec 2007 14:17 GMT
Well, I added several named ranges into my workbook and created a macro to
insert rows and copy/paste special these names into a list that I am using as
a ‘database’ to warehouse the data to feed the Word templates. I think it is
working; at least it seems to be stable now. I am still curious to know
about those ‘appropriate diagnostics’. Is there a web site out there
somewhere that talks about this?
Cordially,
Ryan---

Signature
RyGuy
> When a problem occurs, the VBE opens and 'UserForm1.Show' is highlighted
> yellow. The Locals Windows shows AutoNew (my sub) and under Value, the
[quoted text clipped - 57 lines]
> > > Regards,
> > > Ryan--