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 7836081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:57:49+00:00 2026-06-02T13:57:49+00:00

In 2003 the workbook would just close. But now the same code is re-opening

  • 0

In 2003 the workbook would just close. But now the same code is re-opening the workbook. There are some lines afterwards and then the sub ends. When the sub ends, the workbook_open event gets fired for the closed workbook, even though there is no code that opens any workbooks. The debugger is almost useless, it is not reproducing the bug if I execute everything step by step, in fact everything works fine when I use the debugger.

I use

ActiveWorkbook.Close False

For closing the workbook (from an add-in).

Help much appreciated.

  • 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-06-02T13:57:50+00:00Added an answer on June 2, 2026 at 1:57 pm

    Figured out how to get both. Workbook_beforeclose cancels the scheduled ontime event by calling:

    Application.OnTime EarliestTime:=Now(), Procedure:="Name", Schedule:=False
    

    but otherwise the ontime event gets executed.

    If the event does not get cancelled before beforeclose is called, the workbook will close then re-open to run the scheduled ontime event (because the workbook is opened so briefly that ontime doesn’t get a chance to run before I need to close it).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to extract the workbook name, but then extract only a
I have an excel 2003 vsto workbook that I would like to make available
First: I'm using Excel 2007, but the code has to work for Excel 2003
Im using access 2003 to view some as400 tables and databases. I would need
I'm refactoring a number of modules in an Excel 2003 workbook and the same
I have an Excel 2003 workbook that contains a macro to copy certain of
I am trying to open excel 2003 workbook and save it as something else,
I'm using the OleDbConnection class to retrieve data from an Excel 2000/2003 workbook: string
As the title explains, I have an Excel 2003 workbook and I'm copying a
I have a program that spits out an Excel workbook in Excel 2003 XML

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.