Hi all, I have some basic code written onto my worksheet, this code should (theoretically) refresh all tables/pivots in the workbook and then hide the sheet after it's closed.
After attempting to run this code the "Workbook.Refreshall" Line throws me an error. I'm assuming someone in here has the proper knowledge and can just tell me pretty easily what was done wrong here.
My assumption was that a Workbook event cannot be nested inside of a Worksheet_ procedure, but hey what do I know, thats why im here!
Any possible workarounds or solutions?
VBA Code:
Private Sub Worksheet_Deactivate()
Workbook.RefreshAll
Me.Visible = xlSheetHidden
End Sub
After attempting to run this code the "Workbook.Refreshall" Line throws me an error. I'm assuming someone in here has the proper knowledge and can just tell me pretty easily what was done wrong here.
My assumption was that a Workbook event cannot be nested inside of a Worksheet_ procedure, but hey what do I know, thats why im here!
Any possible workarounds or solutions?