Even after searching and trying for a long time I am not sure whether it is possible it or not.
I have a PP model using SQL source. Let's say command is:
select * from FactInternetSales where CustomerKey = 11001
and I have filter, 'CustomerKey' and based on the filter selection I want to update the command. For e.g:
select * from FactInternetSales where CustomerKey = 11002
The code I am trying is:
Dim mdl As ModelTable
Dim wcon As WorkbookConnection
Dim cmd As String
Set mdl = ActiveWorkbook.Model.ModelTables("Customers")
Debug.Print mdl.SourceWorkbookConnection.OLEDBConnection.CommandText
mdl.SourceWorkbookConnection.OLEDBConnection.CommandText = "select * from FactInternetSales where CustomerKey = 11002"
Trying to assign a command results in 'Run-time error 1004'
I just come across this link, it seems possible. But I am not getting the 'temporary tables' part. Please share your opinion (and the VBA) code you have used to address this.
Thanks, Prakash