> Perhaps if you gave us more details about what you are trying to do.
Thank you very much , Ralph
Actually I have a database of 231 workbooks in excel
only , and I have a macro which is
doing the querry for extract my
informations that I need from this 231 workbook
database .The macro is write in VBA code ;
Now , I found and I learnt to work with
ADO for extract data from closed workbooks , and
the speed of get results is very fast ;here is( for
example) the macro which extract data from closed workbooks :
Sub GetData_Example1()
' It will copy the Header row also (the last two arguments are True)
' Change the last argument to False if you not want to copy the header
row
GetData ThisWorkbook.Path & "\WAVE\YTA1.xls", "1", _
"B91:B636", Sheets("1").Range("B5"), True, False
End Sub
If ADO could be done and 2 more things ,posted
before , it will be extraordinary ; I look for SPEED !!!
The speed for me mean a bigger database , what I
want and looking for ! .....
I have need a method to autofill range :
Range("B91:B65536").Select
Selection.AutoFill Destination:=Range("B91:BB65536"),
Type:=xlFillDefault
(so look in VBA code)
and the second thing , to ClearContents range :
Sheets("1").Range("C91:BB65536").ClearContents
(so look in VBA code);
My problem is to know if ADO can do this things ,
and if it work faster then my actually VBA code !
Thank you very much again !
Respectfully
Ralph - 21 Mar 2008 04:18 GMT
> > Perhaps if you gave us more details about what you are trying to do.
>
[quoted text clipped - 39 lines]
> Thank you very much again !
> Respectfully
If you can compose a query that returns the records that are equivalent to
"Range( ...)" then you could simply loop through the records setting the
*Field* of interest to the new value (either some default, incremented
value, etc, or null, empty, etc.) then update the database, in this case,
Excel.
I don't know if that would be any faster or not.
-ralph
ytayta555 - 21 Mar 2008 12:19 GMT
Many thanks , Ralph
I'm beginner in ADO , I don't know to
write querry in ADO to corespund to this 2
actions in VBA : Range("B91:B65536").Select
Selection.AutoFill Destination:=Range("B91:BB65536"),
Type:=xlFillDefault , and Sheets("1").Range("C91:BB65536").
ClearContents ;
This are only 2 things I need (and I don't know if
ADO do this actions with workbook not open ).
Ralph - 21 Mar 2008 15:21 GMT
> Many thanks , Ralph
>
[quoted text clipped - 6 lines]
> This are only 2 things I need (and I don't know if
> ADO do this actions with workbook not open ).
This should get you started...
"How To Use ADO with Excel Data from Visual Basic or VBA"
http://support.microsoft.com/kb/257819
-ralph
ytayta555 - 21 Mar 2008 15:47 GMT
maybe can combin ADO with SQL to
do autofill and clearcontents in a closed
workbook ?
Many thanks for sugestions , Ralph