Hi Werner, Ricardo,
actually the coding is working and returns the "DS_7", but only if you are in one crosstab.
Still, as callback is getting called not only if you refresh I have added now the following coding to bypass the type mismatch.
Its not nice but at least its providing me the correct behavior. If have used now crosstab first to run the case statement
Public Sub Callback_AfterRedisplay()
.... some dim etc.. here.
lResult = Application.Run("SAPGetCellInfo", ActiveCell, "CROSSTAB")
sourceCrossTab = lResult
'Very important to have this line below as callback starts for several actions in Excel
'and if a cell is not selected the If statement would fail with type mismatch
'you also have to add the goto points.
On Error GoTo ignoreCallback
Select Case sourceCrossTab
Case "Crosstab7"
Set resultArea = Range("SAP" & sourceCrossTab)
...... some body here.
GoTo goodEnd
ignoreCallback:
'MsgBox "Error.."
goodEnd:
' in case you want to place a message raise it here.
End Sub
Ralf