Hello Hans-Jörg,
just my 2 cents...
As you can see that the idea is already 2 years old, I would propose the following workaround:
This all works only if you don't get the "result set size limit exceeded" error... and you need to know how to work with VBA.
1) since you know the numbers/values which you want to exclude, you could store it in the same Excel as your Datasource is included, but on a second sheet ("bad list").
2) Now you select all the data without the exclusion restriction.
3) then you copy & paste the column with those values to the second sheet, too. Then remove all values which are available in the selected data but also in the "bad list".
4) Select the remaining numbers ("positive list") and fill them into the variable, which you wanted to use for exclusion:
Dim lResult As Long
Dim vntData As Variant
Set ObjRange = Range(Sheets("Table1").Cells(1, 1), Sheets("Table1").Cells(3, 3))
vntData = ObjRange.value
lResult=Application.Run("SAPSetVariable", "<techn-var-name>", vntData, "INPUT_STRING", "DS_3")
Then refresh the query again... voila, exclusion by inclusion ;-)
Unfortunately If you want to re-do this, or save the Workbook, the Input varible will keep those values and you need to clear it by Setting one Default value, which you can remove manually in the variable Screen.
It needs a little bit experimenting, but it could work.
Best regards, Martin