I have a very simple piece of VBA which sets some slicers, refreshes a connection and puts a message on the status bar, but I have noticed one message doesn't go away.
This connection is not critical to the running of the spreadsheet as it just gives an overview when required - usually on by me.
however, I would like it to disappear when the refresh is complete but can see no way of doing this - it just stays resident on the status bar.
This connection is not critical to the running of the spreadsheet as it just gives an overview when required - usually on by me.
however, I would like it to disappear when the refresh is complete but can see no way of doing this - it just stays resident on the status bar.
VBA Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
On Error Resume Next
Dim sc1 As SlicerCache
Dim sc2 As SlicerCache
Dim SI1 As SlicerItem
' These names come from Slicer Settings dialog box
Set sc1 = ThisWorkbook.SlicerCaches("Slicer_Sales_Office")
Set sc2 = ThisWorkbook.SlicerCaches("Slicer_Customer_Region_Name")
sc2.ClearManualFilter
For Each SI1 In sc1.SlicerItems
sc2.SlicerItems(SI1.Name).Selected = SI1.Selected
Next SI1
Application.StatusBar = "Calculating workbook..."
Calculate
Columns("F:F").ColumnWidth = 4
Application.StatusBar = "Refreshing Data..."
ActiveWorkbook.Connections("Query - Dataset").Refresh
[B][COLOR=rgb(184, 49, 47)]'What can I here to make the message go away when the refresh has completed?[/COLOR][/B]
End Sub