I have an Excel macro that reads data from another file using ADO and SQL. It runs fine but it takes too long
Here is the part of the code that connects to the other file.
With conn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Mode = adModeRead
.CursorLocation = adUseClient
.Properties("Data Source") = "W:\Store.xlsm"
.Properties("Extended Properties") = "Excel 12.0 Macro;HDR=Yes;IMEX=1"
.Open OpenForwardOnly, LockReadOnly, CmdText
End With
Set rs = conn.Execute("SELECT `main$`.`" & MasterField & "` FROM `main$` `main$` WHERE `main$`.Num= '" & Hyperion & "'")
Master = rs.Fields(0).Value
Thank you!