Skip to Content
Jan 19, 2016 at 05:44 AM

Workbook Crosstabs under data source is out of sync.


Hi All,

In workbook i have 2 crosstabs (Crosstab1 and Crosstab2) under one data source DS_1 , where each crosstab is placed in 2 different sheet.

On launaching of the workbook i refresh the data source DS_1 so crosstabs in 2 different sheet also get refreshed.

After refreshing of data source , when i am executing SAPGetCellInfo API to extract the related information as below, it's failing and giving an error as Error2042

lvariant = Application.Run("SAPGetCellInfo", "ActiveCell", "Selection", "ZSTKEYFIG")

so i tried to extract the error information from API SAPGetlastError , it showed following error:

Crosstab "Crosstab1" is out of sync. Please refresh it.

However reinserting the crosstabs again is resolving the issue , but refreshing/reinserting every time on launching the workbook doesn't make any sense. Please help me in resolving this issue.

Thanks in advance