This is not provided as a part of ToExcel() method.
However, there are two ways of doing it.
Approach-1
a) SetFilter to the condition. oBrw:Refresh()
b) ToExcel()
c) Clear filter and oBrw:Refresh()
Approach-2
a) Prepare an array of RecNo()s to be exported.
Example:
aRecNo := {}
( oBrw:cAlias )->( DBEVAL( { || AAdd( aRecNo, RECNO() ) }, { || your condtion } ) )
b) Assign oBrw:aSelected := aRecNo
c) oBrw:ToExcel()
d) Clear oBrw:aSelected := {}
To see how the second method works, first test this small sample
XBROWSER "STATES.DBF" SETUP ( oBrw:bRClicked := { |r,c,f,o| ;
o:aselected := { 2,3,4 }, o:ToExcel(), o:aselected := {} } )