For the lack of the variable appearing portion of the question. Is the datasource a published data source on server or an embedded data source contained just within the workbook? I ask because the documentation states that the WorkBookName value is only usable for an embedded connection type.
There are no references I can locate for passing the name of the datasource as a parameter. You might consider adding this as an Ideas if the use case is one that could be valuable to several users of Tableau. Remember to vote up your own Idea if you do add it.