-1

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!

braX
  • 11,506
  • 5
  • 20
  • 33
Gonzalez
  • 7
  • 1
  • 6

1 Answers1

0

Consider using .xlsb copy of the file.

Hassan Voyeau
  • 3,383
  • 4
  • 22
  • 24