Hello,
I implemented the Highlight Changed Cells Function as described in the How-To-Paper from Gerd Schoeffl (How To...Highlight Changed Cells in SAP BusinessObjects Analysis for Office).
In my workbook I have two tabs with different crosstabs. I noticed that the highlighting function only works for one of them and that there is a warning for the other one: "There is no named range for Crosstab1". In the coding I saw that the error message is put out by the Highlighting Changed Cells subs but I am not sure why the problem occurs (I could not find out at which point of the runtime the error occurs, even when I tried debugging it).
When I restrict the selection to less cells it works for the same crosstab. Therefore I would assume that there are simply too many cells for the function to work, is that possible? And if so, has anybody found a solution? In the crosstab there are 376 rows and 21 columns...
This is the code that contains the error message:
Sub createMapInitial(CrossTabName As String)
Dim map As Object
Dim cross As Range
Dim Cell As Variant
Set map = CreateObject("Scripting.Dictionary")
On Error GoTo RangeNotFound
Set cross = Range("SAP" + CrossTabName)
Dim RowSel As Object
Dim ColSel As Object
Dim rowkey As Variant
Dim colkey As Variant
Dim keyMap As String
' delete the last selection tables
If Not RowSel Is Nothing Then
Set RowSel = Nothing
End If
If Not ColSel Is Nothing Then
Set ColSel = Nothing
End If
Set RowSel = CreateObject("Scripting.Dictionary")
Set ColSel = CreateObject("Scripting.Dictionary")
Call FillSelTabs(CrossTabName, RowSel, ColSel)
For Each Cell In cross
If isDataCell(Cell) = True Then
rowkey = RowSel.Item(Cell.row)
colkey = ColSel.Item(Cell.column)
keyMap = rowkey + colkey
Call map.Add(keyMap, Cell.value)
End If
Next
Call MapCollection.Add(CrossTabName, map)
On Error GoTo 0
Exit Sub
RangeNotFound:
Dim text As String
text = "There is no named range for " + CrossTabName
Call Application.Run("SAPAddMessage", text)
On Error GoTo 0
End Sub
Thanks, Jan