Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6548619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:59:31+00:00 2026-05-25T11:59:31+00:00

I am working and excel addin and I am under the need to open

  • 0

I am working and excel addin and I am under the need to open a new window of the same workbook to enter data in a different worksheet. For the new window, I will need to know when the window is being closed so I can do some validations on the data entered. Is there a way to know when a Workbook window is being closed?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:59:31+00:00Added an answer on May 25, 2026 at 11:59 am

    Take a look at this document:
    http://support.microsoft.com/kb/213566

    Create a Module and a Class Module. Code is below.

    Class Module code:

    Public WithEvents appevent As Application
    
    Dim windowsCount As Integer
    
    
    Private Sub appevent_WindowActivate(ByVal Wb As Workbook, ByVal Wn As Window)
    If windowsCount <> Application.Windows.Count Then
        MsgBox "You closed a window"
    End If
    End Sub
    
    
    Private Sub appevent_WindowDeactivate(ByVal Wb As Workbook, ByVal Wn As Window)
    windowsCount = Application.Windows.Count
    End Sub
    

    Module Code:

    Dim myobject As New Class1
    
    
    Sub Test()
    
    Set myobject.appevent = Application
    
    End Sub
    

    And this handler for the workbook:

    Private Sub Workbook_Open()
    Test
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an big excel-addin with many modules. I need to export them
I'm working on an Excel 2003 addin (users will upgrade to newer Office, but
I am working with excel report in Open ERP with report_aeroo module. I want
I have a large data set that I'm working with in excel. About 1000+
I am working on an Excel workbook add-in where I'm supposed to add a
I'm working on an Excel Addin (VSTO) in .NET that connects to an Oracle
When working with Excel 2010, I try to save data as an XML Data
The workbook I am working on in Excel uses graphics with 3d properties which
I have an working Excel file, with file I can send data extracted from
While working with an excel file (.xlsx), the data I get from it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.