I have 2 ActiveX command button on a worksheet. The cmd_AddNewProj button works as expected, but the cmd_Refresh button does not work. The code works when I hit F5, but when I click the actual button, a 2nd image of the button pops up. I'm not in design mode. Thoughts?
VBA Code:
Private Sub cmd_AddNewProj_Click()
frm_NewJob.Show
End Sub
Private Sub cmd_Refresh_Click()
Dim m As Workbook
Dim mS As Worksheet, mI As Worksheet
Dim mILR As Long
Set m = ThisWorkbook
Set mS = m.Sheets("Summaries")
Set mI = m.Sheets("Inventory")
mILR = Sheets("Inventory").Range("D" & Rows.Count).End(xlUp).Row
mS.Activate
With ActiveSheet
.PivotTables("InvSummary").ChangePivotCache ActiveWorkbook.PivotCaches.Create(xlDatabase, SourceData:=m.Sheets("Inventory").Range("A1:R" & mILR))
End With
End Sub