Friday, September 9, 2016

Cloning a Data Source in Another Workbook

We may need to reuse the same data sources times and again in one project. We may need to clone a data source in different workbooks. Helas, there is no copy-n-paste option for data sources. (Submitted a feature request and please upvote it if you like it.)

Saving a data source is an available option. But you may not want to have the connection information saved in a local tds file for security reasons. I feel copy-n-paste is a better option in many ways.

The hassle is in repetitively filling the same credentials for a database or finding the same path to a data file. In a previous post, I described how to clone a data source in the same workbook. Now how to recreate the same data source in another workbook?

Here is a trick to save the hassle.

1.Open a new worksheet in workbook A.
Assume the data source of interest is in workbook A already. We want to have it in workbook B as well.

2.Drag "Number of Records" of the data source in question to the canvas
3.Copy the sheet 
Right click the sheet tab and copy.
4.Paste it into workbook B 
Right click the new sheet button or any sheet tab. You will see "Paste Sheet" option.
Now you have the data source in the new workbook! You can then edit the data source to use a different table or to join a few tables. What is cloned is the connection, the required credentials and the server address. You can change to a different table by editing that same connection.

All the above can be made easier if we have a copy-n-paste option! So please upvote it.

No comments:

Post a Comment