Announcement

Collapse
No announcement yet.

Delete Personal Macro Workbook

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Delete Personal Macro Workbook

    When using Vista and Excel 2007, Everytime I open a Workbook (.xls usually) I notice that Excel also opens up a Personal.xlsb file. This doesn't really get in the way but it is really annoying when I try to close excel. I have to do it twice to also close out the Personal.xlsb too. It does interfer with code that will Quit excel if only 1 workbook is open otherwise only close the 1 workbook.
    Code:
    Sub WorkBookClose()
    If Application.Workbooks.Count <= 1 Then
    ThisWorkbook.RunAutoMacros Which:=xlAutoClose
    Application.Quit
    Else
    ThisWorkbook.RunAutoMacros Which:=xlAutoClose
    ThisWorkbook.Close False
    End If
    End Sub
    I can always change the workbook count to 2 but that can potentially cause problems. Is there a way to determine if that Personal.xlsb file is empty and not being used? What the heck is this even used for?

    I don't want to force a close on a workbook that someone is working on or a workbook that might be important. I've not heard of the .xlsb file type before and could use a little advise. Is there a way to stop it from opening automatically or is there a good way to deal with it. The only other thing I can think of is something like this:
    Code:
    Sub WorkBookCloseV2()
    Dim wbBook As Workbook
    If Application.Workbooks.Count <= 2 Then
        For Each wbBook In Application.Workbooks
            If wbBook.Name = "PERSONAL.XLSB" Then
                ThisWorkbook.RunAutoMacros Which:=xlAutoClose
                Application.Quit
            End If
        Next
    End If
    ThisWorkbook.RunAutoMacros Which:=xlAutoClose
    ThisWorkbook.Close False
    End Sub
    This still doesn't stop the need to have to hit the Top Right X Twice to Close out Excel unless I use the same code also in a beforeClose Event. Any suggestions or advise? Thank You

  • #2
    Re: Prevent Or Close Personal.xlsb

    If you don't need it, delete it.

    C:\Users\UserName\AppData\Roaming\Microsoft\Excel\XLSTART\PERSONAL.XLSB

    Comment


    • #3
      Re: Delete Personal Macro Workbook

      Well that just fixed my whole problem. Thanks Dave

      Comment


      • #4
        Re: Delete Personal Macro Workbook

        For those still having trouble finding their PERSONAL workbooks...

        That path doesn't exist on my computer (running XP with Excel 2002 SP3); there is no "Users" folder on my C: drive.
        The path to my Personal workbook is:

        C:\Documents and Settings\UserName\Application Data\Microsoft\Excel\XLSTART\PERSONAL.XLS

        (I don't/didn't have a .XLSB version)

        Comment


        • #5
          Re: Delete Personal Macro Workbook

          Doesnt it hold any global macros/vba codes you have created? Deleting it will delete those procedures.

          Comment


          • #6
            Re: Delete Personal Macro Workbook

            It varies by version of Windows, obviously with Excel 2000 it would not be Personal.xlsb. 2000 does not support that extension, it would be personal.xls. Only versions since 2007 will have .xlsb

            Windows XP

            C:\Documents and Settings\Application Data\Microsoft\Excel\XLSTART\PERSONAL.XLS

            Windows 7

            C:\Users\AppData\Roaming\Microsoft\Excel\XLSTART\PERSONAL.XLS

            Excel 2007

            C:\Program Files\Microsoft Office\Office12\XLSTART\PERSONAL.XLSB

            Excel 2010

            C:\Program Files\Microsoft Office\Office14\XLSTART\PERSONAL.XLSB

            Excel 2013

            C:\Program Files\Microsoft Office\Office15\XLSTART\PERSONAL.XLSB

            No Office 13 was used by superstitious MS
            Hope that Helps

            Roy

            New users should read the Forum Rules before posting

            For free Excel tools & articles visit my web site

            If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need

            RoyUK's Web Site

            royUK's Database Form

            Where to paste code from the Forum

            About me.

            Comment


            • #7
              Re: Delete Personal Macro Workbook

              You can check (version independent) using:

              Code:
              Sub M_snb()
                 MsgBox Application.StartupPath & "\" & Dir(Application.StartupPath & "\Pers*")
              End Sub

              Comment

              Working...
              X