Reading Data using OLEDB from opened Excel File
I have an excel file(Lets' say File X) with 2 sheets. In first sheet I display charts. Second I have data for the chart. In order to get data from chart, I need to process that data as we do in SQL like Group by, order by. Is there any way I can use oledb to read data from second sheet using VBA code in same excel file(file X)? Thanks!! Here's an example of using SQL to join data from two ranges: it will work fine if the file is open (as long as it has been saved, because you need a file path). Sub SqlJoin() Dim oConn As New ADODB.Connection Dim oRS As New ADODB.Recordset Dim sPath Dim sSQL As