Apologies Richard but I'm pretty new to this.
Does it make a difference if my data is coming from a pivot table? I tried the following code:
Worksheets("pivot").QueryTables(1).Connection = strConn
and I got the error "Subscript out of Range"
I also tried
Worksheets("pivot").QueryTables("PivotTableSource").Connection = strConn
and got the same error. I then tried
Worksheets("pivot").PivotTable("PivotTableSource").Connection = strConn
and got the message "Object doesn't support this property or method"
Apologies if I am doing something stupid. Thanks again.
Bookmarks