Copy range from closed file

O

OJ

Hi,
there are a couple of ways to do this. One way is to use an
ExecuteExcel4Macro with the Cell.Get method. Another, if your data is
set out in a DB format is to use ADO. Also, you can always link the
cells and update links!!

Hth,
O
 
O

OJ

Hi Ron,
On your example you use this line
' Check to make sure we received data and copy the data
If Not rsData.EOF Then

Is this reliable? I have always used...

If Not rsData.BOF then rsData.MoveFirst....

OJ
 
R

Ron de Bruin

Hi OJ

I don't use it very much myself and Rob bovey helped me make this example.
I have never have problems with it but you good be right.
Maybe a ADO expert can tell us ?

Ron
 
J

Jamie Collins

Ron said:
I don't use it very much myself and Rob bovey helped me make this example.
I have never have problems with it but you good be right.
Maybe a ADO expert can tell us ?

I lieu of an ADO expert... When opening an ADO recordset the position
will either be at row 1 (the equivalent of MoveFirst) or at EOF is
there are no rows. DAO behaves slightly differently from ADO e.g. in
DAO you have to MoveLast to get an accurate RecordCount but it's always
reliable in ADO. Perhaps OJ's code is a DAO hangover?

Jamie.

--
 
P

Peter T

Hi Ron,

Thanks for your providing your ADO example. You specified setting a
reference to
Microsoft ActiveX Data Objects 2.5 library
msado25. does not exist on my Win 98 machine. I think it was first shipped
with Win2000. However changing the reference to version 1.5 and your example
works fine.

Don't suppose many still use Win98 - but just in case!

Regards,
Peter T
 
J

Jamie Collins

Peter said:
Thanks for your providing your ADO example. You specified setting a
reference to
Microsoft ActiveX Data Objects 2.5 library
msado25. does not exist on my Win 98 machine. I think it was first shipped
with Win2000. However changing the reference to version 1.5 and your example
works fine.

Version 1.5 is extremely aged. The latest version MDAC 2.8 can run in
Win98 and is available as download (including a redistributable):

http://msdn.microsoft.com/data/mdac/default.aspx

Jamie.

--
 
P

Peter T

Jamie - thanks for the tip but.
Version 1.5 is extremely aged. The latest version MDAC 2.8 can run in
Win98 and is available as download (including a redistributable):

http://msdn.microsoft.com/data/mdac/default.aspx

I downloaded MDAC 2.8 / Mdac_typ.exe and ran the setup which did the usual.
I had previously existed all programs and accepted the prompt to restart my
system.

Windows would not exit - Ctrl Alt Delete showed just the following remaining
from the setup app:
Dasetup
Mdac-typ

I did "End task" for each followed by total crash!!!!

Restarted manually and Windows restored a backup of my registry (years since
it's needed to do that).

Sigh of relief as all appears OK. Loaded Ron's file and now it has the
previously missing reference to MADO 2.5 in place. His routines work fine
(as they did with v 2.1).

Curiously though I cannot see any references in the list to v2.8. Possibly
because Windows restored a backup registry.

Regards,
Peter T

PS, Prior to the setup I had downloaded and ran "Componant Checker" as
recommended on the download page, to inform me of I'm not quite sure what!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top