VBA for retrieving the sharepoint list with a condition

The following code extracts the list perfectly. However, I am looking for help to extract based on a condition.

Dim objMyList As ListObject
Dim objWksheet as a worksheet
Dim strSPServer As string
Dim strFilter As String
Const SERVER As String = "Sharepoint Site Name"
Const LISTNAME As String = "{XXX-E8AE3D708B81}"
Const VIEWNAME As String = "{XXXC26E71804CE3}"
strSPServer = "https: //" & SERVER & "/ _vti_bin"
Set objWksheet = Sheet3
strFilter = "Apples"
Set objMyList = objWksheet.ListObjects.Add (xlSrcExternal, _
Array (strSPServer, LISTNAME, VIEWNAME), False ,, Range ("b8"))

I have another code snippet that extracts based on a condition. The problem with the code, however, is that it does not extract it in the synchronizable table that execute the previous codes.

    Dim strConnection As String
Dim strSQL As string
Dim strFilter As String
strFilter = "Apples"
strSQL = "SELECT [FIELDNAME2] FROM list WHERE FIELDNAME = "& Chr (34) & strFilter & Chr (34)
strConnection = "OLEDB; Provider = Microsoft.ACE.OLEDB.12.0; WSS; IMEX = 0; RetrieveIds = Yes; DATABASE = MYSHAREPOINTSITE; LIST = {XXXXXCE10-4963-B00C-E8AE3D708B81};"

With ActiveSheet.QueryTables.Add (connection: = Array (strConnection), Destination: = Range ("b5"), SQL: = strSQL)

.CommandText = Array (strSQL)
.Name = "Data from the SP list"
.FieldNames = True
.PreserveFormatting = True
.BackgroundQuery = True
End with

I hope someone can help modify the first code and add the WHERE clause or the second one and get it in spreadsheet format so I can sync myself once I'm done with the changes.