3 weeks ago
Hello,
I'm using the SAPSetFilter function in VBA for one of my files. To set the filter member, I'm using a variable defined as a String. This approach has worked for the last two years, but recently, I'm encountering an error message when running the file.
It seems the issue is related to the size of my variable. When I reduce the number of items used to populate this variable, the file runs without any issues.
Here is the relevant part of my VBA code:
' Set variable Filter with list of Opportunities Dim Filter As String For compteur = 5 To wsListOpp.Range("C" & Rows.Count).End(xlUp).Row AllOpp = wsListOpp.Range("C" & compteur).Value Filter = Filter & AllOpp & "," Next ' Update AfO Filter Dim Filter0 As Long Filter0 = Application.Run("SAPSetFilter", "DS_1", "OPPORTUNITY_ID", Filter, "INPUT_STRING")
Is there a workaround to extend the size limit of the Filter variable when using SAPSetFilter? Interestingly, when I manually copy my list of Opportunities and set the OPPORTUNITY_ID filter without VBA, it works fine.
Thank you for your insights!
Christophe
Request clarification before answering.
User | Count |
---|---|
24 | |
22 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.