Sub ClosewithoutsaveAndReopen()
'Defines Variables
Dim nameOfCurrentWorkbook As Variant
Dim nameOfCurrentWorkbookPath As Variant
'Finds the name of the current workbook
nameOfCurrentWorkbook = ActiveWorkbook.Name
'finds the current path of hte workbook
nameOfCurrentWorkbookPath = ActiveWorkbook.Path
ActiveWorkbook.Close False
'Reopens the same worbook you just closed
Workbooks.Open (nameOfCurrentWorkbookPath & "\" & nameOfCurrentWorkbook)
End Sub
No comments:
Post a Comment