Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Using ADO to get data from Worksheet in Same Workbook

Here is an easy one for somebody. I have a workbook where one of the
worksheets contains columns of data and another worksheet is a summary
of that data. I can use formulas in the summary sheet. I can also use
something like EVALUATE(FORMULA) in VBA. But, is it possible to use
ADO to connect to the Data sheet and populate the Summary sheet using
queries against that data?

tod
  #2   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Using ADO to get data from Worksheet in Same Workbook

Hi,

I think the short answer to your question is likely "Yes" it is possible to
query an XL sheet using ADO; however, this may be limited by your knowledge
of SQL to execute the appropriate queries to return what you need in summary
form. If you know SQL well enough then that won't be a problem.

However, XL is a spreadsheet, not a database and often the data is not
consistently formatted; for example, numbers, text, formulas, and/or dates
residing in the same columns; this poses problems as ADO will only import the
predominant data type in any given column, anything else will be ignored, or
dropped from the query.

Also, the last time I checked into this (a couple years ago) the only way to
reliably query an XL sheet using ADO was to do so from another workbook (or
another app), because the workbook being queried needs to be closed when the
query is executed.

NOW, this may have changed and newer versions of ADO may have corrected this
issue, but it is something to consider. There may have been a work-around for
that issue as well, but I don't recall for sure.

If you still want to pursue it there are a lot of posts out there on ADO and
some excellent web sites that cover it (even if you just google it). Ron
DeBruin's page has some examples of ADO: http://www.rondebruin.nl/tips.htm

Hope this at least gives you a few ins/outs on it...

"todtown" wrote:

Here is an easy one for somebody. I have a workbook where one of the
worksheets contains columns of data and another worksheet is a summary
of that data. I can use formulas in the summary sheet. I can also use
something like EVALUATE(FORMULA) in VBA. But, is it possible to use
ADO to connect to the Data sheet and populate the Summary sheet using
queries against that data?

tod

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Using ADO to get data from Worksheet in Same Workbook

hi
if the sheets are in the same workbook, i see no reason to use ADO. a
regular sub should be sufficient. and if you are using formulas to summerize
the data, why complicate it with a lot of code unless the formulas are
lacking somehow. did you leave something out of your post?????
regards
FSt1

"todtown" wrote:

Here is an easy one for somebody. I have a workbook where one of the
worksheets contains columns of data and another worksheet is a summary
of that data. I can use formulas in the summary sheet. I can also use
something like EVALUATE(FORMULA) in VBA. But, is it possible to use
ADO to connect to the Data sheet and populate the Summary sheet using
queries against that data?

tod

  #4   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Using ADO to get data from Worksheet in Same Workbook


Yeah, for what it's worth, I seldom use anything more than array formulas to
produce summaries very quickly...however, there has been some discussion in
the past (in this forum) that, depending upon what you are trying to
accomplish) ADO may have superior speed in very large spreadsheets (like 50k+
rows of data)...

"FSt1" wrote:

hi
if the sheets are in the same workbook, i see no reason to use ADO. a
regular sub should be sufficient. and if you are using formulas to summerize
the data, why complicate it with a lot of code unless the formulas are
lacking somehow. did you leave something out of your post?????
regards
FSt1

"todtown" wrote:

Here is an easy one for somebody. I have a workbook where one of the
worksheets contains columns of data and another worksheet is a summary
of that data. I can use formulas in the summary sheet. I can also use
something like EVALUATE(FORMULA) in VBA. But, is it possible to use
ADO to connect to the Data sheet and populate the Summary sheet using
queries against that data?

tod

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Using ADO to get data from Worksheet in Same Workbook

yes, i have heard that too. but to date, i haven't tried that to see. I have
used ADO when working with access but i use MSQ more than ADO. the op was a
little foggy on what he was trying to do and gave no indications that he was
working on a large spreadsheet and based on his post, why bother unless it's
a learning thing. i've done that.

Regards
FSt1

"XP" wrote:


Yeah, for what it's worth, I seldom use anything more than array formulas to
produce summaries very quickly...however, there has been some discussion in
the past (in this forum) that, depending upon what you are trying to
accomplish) ADO may have superior speed in very large spreadsheets (like 50k+
rows of data)...

"FSt1" wrote:

hi
if the sheets are in the same workbook, i see no reason to use ADO. a
regular sub should be sufficient. and if you are using formulas to summerize
the data, why complicate it with a lot of code unless the formulas are
lacking somehow. did you leave something out of your post?????
regards
FSt1

"todtown" wrote:

Here is an easy one for somebody. I have a workbook where one of the
worksheets contains columns of data and another worksheet is a summary
of that data. I can use formulas in the summary sheet. I can also use
something like EVALUATE(FORMULA) in VBA. But, is it possible to use
ADO to connect to the Data sheet and populate the Summary sheet using
queries against that data?

tod

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using ADO to get data from Worksheet in Same Workbook todtown Excel Programming 0 July 29th 08 03:57 PM
Get data from another worksheet in same workbook klassic Excel Programming 1 November 1st 07 05:22 PM
Look up Data from Worksheet within same Workbook JLatham New Users to Excel 5 May 14th 06 06:58 PM
Look up Data from Worksheet within same Workbook Max Excel Discussion (Misc queries) 0 May 10th 06 06:50 AM
Copy Data from Workbook into specific Worksheet in other Workbook? kingdt Excel Discussion (Misc queries) 1 March 16th 06 06:55 PM


All times are GMT +1. The time now is 03:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"