How can I use an ADO connection string with pivot table? When I macro recorded the pivot table using outside source data, it used DAO.
How can I use an ADO connection string with pivot table? When I macro recorded the pivot table using outside source data, it used DAO.
You can use something like:
[VBA] Dim pc As PivotCache
Set pc = ActiveWorkbook.PivotCaches.Add(xlExternal)
pc.Connection = "OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Test\db1.mdb"
[/VBA]
Regards,
Rory
Microsoft MVP - Excel
This is what I'm talking about. Many thanks.