+ Reply to Thread
Results 1 to 5 of 5

VBA Project not closing after closing Excel file

  1. #1
    Registered User
    Join Date
    08-28-2016
    Location
    EDINBURGH
    MS-Off Ver
    2016
    Posts
    3

    VBA Project not closing after closing Excel file

    Hi

    I have been having a problem since upgrading to Excel 2016 I'm hoping someone can help with. The problem is that after closing a file with a macro built in the macro still exists when looking at the VBA Editor although the Excel file is closed. This causes Excel to crash when working on the next spreadsheet I open. I have been avoiding the crash by always exiting Excel after closing a file with a macro built in then re-opening it but I am trying to solve the bug.

    I have already taken various actions after surfing the web without success. The actions being as follows:

    Disabled the only COM add-in that was enabled.
    Checked a Personel.xlsb file did not exist after reading that this should be deleted
    Deleted the Ribbon and allowed this to be recreated automatically in case it was corrupt.

    Does anyone have any other suggestions?

    Thanks

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA Project not closing after closing Excel file

    1. Can you open the workbook but not run the macro and then close the workbook; does the macro still persist?
    2. Is the macro using Application.OnTime?
    3. In the code, are you calling a library?
    4. What does the macro do?
    5. Can you show the code?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA Project not closing after closing Excel file

    Hi GOGGS

    Is the Macro File an xla or xlam File (Excel Add-In)?
    Last edited by jaslake; 08-28-2016 at 06:00 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    08-28-2016
    Location
    EDINBURGH
    MS-Off Ver
    2016
    Posts
    3

    Re: VBA Project not closing after closing Excel file

    Hi

    The macros are all on xlsm files. I carried out a simple test that cancels out a number of possibilities. I created a new one line macro on a
    new xlsm file. This executing the command MSGBOX. I then saved the file and 'closed' it. I opened a new file and the macro was still visible in
    the VBA editor. It is no longer available to run via the 'Developer' tab on the ribbon but can be selected in the VBE editor and stepped into?

    Thanks for any help.

  5. #5
    Registered User
    Join Date
    08-28-2016
    Location
    EDINBURGH
    MS-Off Ver
    2016
    Posts
    3

    Re: VBA Project not closing after closing Excel file

    Hi

    I noticed another mystery when testing that may indicate what is causing the problem. The references box on the VBA editor refers to the file that has been closed without successfully closing the VBA Editor. See below:

    box.JPG

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Closing workbook causes VBA Project Password Prompt to appear
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 11-12-2020, 03:39 PM
  2. User Form causing Prompt for VBA Project Password when closing Excel
    By avr5iron in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-16-2016, 07:16 PM
  3. User Form causing Prompt for VBA Project Password when closing Excel
    By ltgomes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2016, 02:39 PM
  4. Closing a workbook excel requires vba project password
    By necalabria in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2016, 11:43 AM
  5. Excel 2013 not closing after closing workbook
    By SBennett212 in forum Excel General
    Replies: 4
    Last Post: 04-04-2015, 11:07 AM
  6. Creating new workbook, saving as csv and then closing - but closing always fails.
    By ella626 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2014, 10:05 PM
  7. Replies: 0
    Last Post: 03-25-2005, 11:06 AM

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