On Fri, 21 Mar 2008 04:27:20 -0700 (PDT), ytayta555
<(E-Mail Removed)> wrote:
>Can somebody please to learn me if ADO
>can do an autofill method in a closed workbook ? ...
>... to do in a closed workbook the same action
>like in VBA :
>Range("B91:B7000").Select
> Selection.AutoFill Destination:=Range("B91:BB7000"),
>Type:=xlFillDefault
>
What kind of data is in B91? Is it a number? A date? ADO can't do an
AutoFill, but you may be able to do something similar. Generally when you
use ADO to read or write to a closed workbook, the worksheet to which you
are writing is set up like a database table - that is, each row is like a
record and each column is a field.
>
>2.The second thing is to know if ADO can do ClearContents in a closed
>workbook like in VBA code :
>Sheets("1").Range("C91:BB22005").ClearContents,
>but with the workbook not open .
I think you can simply write a bunch of empty strings. It wouldn't be the
same as ClearContents, but it may suit your needs. The same concern about
setting up your worksheet as a table applies.
Having said all that, I agree with everyone else who said this sounds like a
bad idea.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com