View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
kurb kurb is offline
external usenet poster
 
Posts: 24
Default Determining last row/column using ADO with closed workbook

Thank you very much.

I always know where the table beigins so thats ok.

I could not find any method for recordset (in the book that I have)
related to row count and column count
Appreciate a little more clarification please.

On the formula issue, I think that I have to do the calculations on a
local worksheet and then store with ADO, though I will lose on performance.

Thanks
Kurb

Jamie Collins wrote:

kurb wrote ...



I am trying to figure how to use ADO to retrieve/store data into closed
workbook to get hopefully significant performance enhancement what I
currently do (open and close 100 workbooks)
My question: is it possible to find out what the last row and column is
in the closed workbook.?



Using ADO on Excel data:
- You can find out the name of the last column.
- You can find the last value in a column.
- You can count the number of columns and the number of rows.
- If you know where the table begins on the sheet (e.g. cell A1), you
can use the row count and column count to determine the address of the
last cell in the last column.
- By trial and error, you could find out the address of the top left
cell of the table but you would probably lose the performance
advantage.



Can I store a formula into a cell of a closed workbook using ADO. I am
assuming that if this is possible then the value will only be determined
when the workkbook is opened



If you tried to insert a formulas into a cell it would be seen as
plain text, even when it was opened in the Excel UI. You'd need to
're-enter' the cell contents in some way e.g. click into the formula
bar and click out again.

Jamie.

--