I have a bit of VBA which updates connections in a workbook to a new server and/or database name, which you can then update all the tables with. It is useful because I have a lot of SQL linked tables, which would take a lot of time to update manually.
Before anyone says I should use PowerPivot, I'll say that I tried, and unfortunately it regularly crashed or threw up errors. This way works. Sort of...
So, the problem is that at the moment it seems to be throwing a 1004 error, though I'm sure it has been working in the past. A
Here is the code:
cn.OLEDBConnection.Connection... etc is the error line.
Any help would be very gratefully received!
Bookmarks