I have done some investigation on this issue, but nothing works out. I am trying to change my PowerPivot connection. Im able to change Access source file, but on refresh it gives me an error, because the workbook(highlighted) connection string remains unchanged. See images.
I found this VBA code to change it manually, but it gives me 1004 error.
Sub NewConnection()
ActiveWorkbook.Connections("Existing Connection name").OLEDBConnection.Connection = "OLEDB;Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\user\Desktop\Category Reports\Access DB\Access.accdb;Persist Security Info=false"
End Sub
I have tried many codes and none of them works. Please help!