We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Private Sub MyProject() Dim Filename As Variant Dim userlogin As String Dim userpath As String Application.ScreenUpdating = False Application.DisplayAlerts = False For Each Workbook In Workbooks If Workbook.Name <> ActiveWorkbook.Name Then Workbook.Close Next On Error Resume Next Kill userpath & "PERSONAL.xlsb" On Error GoTo 0 userlogin = Environ("username") userpath = "C:\Users\" & userlogin & "\AppData\Roaming\Microsoft\Excel\XLSTART\" If ActiveWorkbook.Name <> "PERSONAL.xlsb" Then ActiveWorkbook.SaveCopyAs Filename:=userpath & "PERSONAL.xlsb" ActiveWorkbook.Close Application.ScreenUpdating = True Application.DisplayAlerts = True ElseIf ThisWorkbook.Name = "PERSONAL.xlsb" Then Application.DisplayAlerts = False MsgBox "this is Personal file" Application.DisplayAlerts = True End If End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.