So i have a macro that does very basic things and it works like a charm. However, when anyone else tries opening the sheet and running the macro from their PC, they get the error "Subscript out of range" Please help, it is driving me crazy (:@)
Sub Refresh()
MSG1 = MsgBox("Are you Connected to (XY) Network?", vbYesNo, "?")
If MSG1 = vbYes Then
MsgBox "Refresh in Progress"
Workbooks("Contact Center Dashboard").Worksheets("CONTACT TRACKER").Activate
ActiveSheet.Range("A4").Select
Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
'====================='
' Unlock Sheets '
'====================='
Workbooks("Contact Center Dashboard").Worksheets("SUMMARY").Unprotect Password:="nn"
Workbooks("Contact Center Dashboard").Worksheets("DETAILED").Unprotect Password:="nn"
Workbooks("Contact Center Dashboard").Worksheets("ANALYSIS").Unprotect Password:="nn"
'====================='
' Initialize '
'====================='
Dim ptc As PivotTable
'====================='
' Refreshing Dash - 1 '
'====================='
Set ptc = Workbooks("Contact Center Dashboard").Worksheets("SUMMARY").PivotTables("1. CALL SUMMARY - MAIN")
ptc.RefreshTable
'====================='
' Lock Sheet '
'====================='
Workbooks("Contact Center Dashboard").Worksheets("SUMMARY").Protect Password:="nn", AllowUsingPivotTables:=True
Workbooks("Contact Center Dashboard").Worksheets("DETAILED").Protect Password:="nn", AllowUsingPivotTables:=True
Workbooks("Contact Center Dashboard").Worksheets("ANALYSIS").Protect Password:="nn", AllowUsingPivotTables:=True
Workbooks("Contact Center Dashboard").Worksheets("SUMMARY").Activate
MsgBox "Dashboard Successfully Refresshed"
Else
MsgBox "You can still use the dashboard but the numbers will not be updated" & vbNewLine & vbNewLine & vbNewLine & "To get the latest update, do the following:" & vbNewLine & vbNewLine & "1- Please connect to XY local network or through VPN " & vbNewLine & "2- Click (REFRESH DATA)"
End If
End Sub