below is my code for the file to be saved to specific folder. my question is how can I make the folder of the location is open automatically after save complete. I google about "aftersave event" but nothing come out .
Private Sub savebr_Click()
Dim saveas As String
saveas = "C:\user\file"
Application.Dialogs(xlDialogSaveAs).Show saveas
End Sub
Thisworkbook.path open every time same workbook path(ie your macro file path)
If your are adding many excel workbooks and save it on different path and want to open this path so you should use below code.
Not necessary to use event for this, you can simply write code after saving workbook.
Private Sub Workbook_AfterSave(ByVal Success As Boolean)
Call Shell("explorer.exe" & " " & Activeworkbook.Path, vbNormalFocus)
End sub
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.