Results 1 to 6 of 6

Automatically close hidden workbooks (Personal.xlsb)

Threaded View

  1. #3
    Registered User
    Join Date
    08-01-2013
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    35

    Re: Automatically close hidden workbooks (Personal.xlsb)

    Okay, thanks for that. Now, I'm not sure I understand what the second thing does (the add-in thing) but it seems to me it's not what I'm looking for.

    The first solution looks interesting, but I don't know how to implement it.
    What does "Public WithEvents App as Application" mean? Where do I select that? Should I create those from the Visual Basic tab? I've put the details below to make it easier.


    Put code into ThisWorkboook module of the PERSONAL.XLSB and save
    Public WithEvents App As Application

    Private Sub Workbook_Open()
      Set App = Application
    End Sub
    
    Private Sub App_WorkbookDeactivate(ByVal Wb As Workbook)
      If Not Me.Windows(1).Visible Then
        If Workbooks.Count = 2 Then
          'If MsgBox("Quit Excel?", vbYesNo + vbQuestion) = vbYes Then
            App.OnTime Now, ThisWorkbook.CodeName & ".QuitMe"
          'End If
        End If
      End If
    End Sub
    
    Private Sub QuitMe()
      App.Quit
    End Sub
    Last edited by JonSnow; 01-29-2014 at 09:16 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 08-07-2013, 09:12 PM
  2. [SOLVED] Working with WorkBook Close event and Personal.xlsb files
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2013, 12:40 AM
  3. control of active workbooks when 2 open and code in personal.xlsb
    By alan_m20 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2012, 02:23 PM
  4. Replies: 0
    Last Post: 05-10-2012, 09:22 AM
  5. Excel 2007 : personal.xls and personal.xlsb in 2007
    By ali84pk in forum Excel General
    Replies: 0
    Last Post: 02-04-2011, 01:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1