Thanks for the reply. But now when I call the function Excel_RangeAutoFilter () I am getting error "No such interface supported'. I have pasted the copy of the code below. My aim is to autofilter column 2 of the workbook as nonblanks.
int Auto_Code_Excel_ResetAutoFilter(void)
{
HRESULT errorCode = 0;
char errorBuffer[256] = {0};
unsigned int bufferSize= 256;
VARIANT field;
VARIANT criteria1;
VARIANT criteria2;
VARIANT visibleDropDown;
VARIANT returnValue;
int ret = 0;
CA_VariantSetEmpty (&field);
CA_VariantSetEmpty (&criteria1);
CA_VariantSetEmpty (&criteria2);
CA_VariantSetEmpty (&visibleDropDown);
CA_VariantSetBool(&visibleDropDown,0);
CA_VariantSetUInt (&field, 2);
CA_VariantSetCString( &criteria1, "<>");
CA_VariantSetCString( &criteria2, "<>");
CA_VariantSetIntPtr(&returnValue,&ret);
errorCode = Excel_RangeAutoFilter (workbookHandle,NULL, field,criteria1,ExcelConst_xlOr,criteria2,
visibleDropDown, &returnValue);
CA_GetAutomationErrorString (errorCode, errorBuffer, bufferSize);
ExcelRpt_WorkbookSave(workbookHandle,"",ExRConst_DefaultFileFormat);
return 0;
}