I have a spreadsheet that first queries a database and stores the values in sheet1. Then I have a separate process that queries this sheet through ADO and outputs the result in sheet2.
For some reason it seems like the ADO query is taking the result from the saved spreadsheet therefore returning old data, instead of taking the data from the open sheet.
How can I make the ADO query take the "live" data from the open sheet, instead of taking it from the saved data?
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Properties("Extended Properties").Value = "Excel 12.0;HDR=Yes;IMEX=1"
globSQL = "SELECT id, InsType, gInsType " & _
"FROM [output$] " & _
"WHERE InsType <> gInsType "
globRS.Open globSQL, objCon
y = 1
For Each fld In globRS.Fields
summary_ws.Cells(1, y).Value = fld.Name
y = y + 1
summary_ws.Cells(2, 1).CopyFromRecordset globRS