Files not properly closing in VBA editor

Rijnsent

Well-known Member
Joined
Oct 17, 2005
Messages
1,424
Office Version
  1. 365
Platform
  1. Windows
Copied my post from reddit -
I'm developing a model with lots of VBA (+XML menu) and a VSTO/COM add-in and bumped into something weird. The behaviour I saw: every second time I open my excel model, it crashes the Add-in. So open once, fine, open twice, error, open three times, fine, etc... The model & add-in interact upon start-up & upon close (commands getting fired from VBA to the add-in).

Upon digging deeper, I saw that the model I was opening was showing twice in the VBA Editor on those "even occasions", so 2 times with the same name. My hunch is that that's the culprit.

So what I did next:
  • I switched off all my (COM) add-ins (so also my own) and made sure my excel has default settings.
  • Next, I rebooted my PC.
  • Start Excel, start new workbook (which shows up as Map1)
  • Open the VBA-editor, see the file there too
  • In Excel, through the menu -> file -> new empty file start a second workbook (Map2)
  • Go to the VBA editor -> both files are there
  • Close Map1 in excel (red cross top right)
  • Go to VBA editor -> both Map1 & Map2 still show
  • Start new files Map3, Map4, close them both
  • VBA editor shows Map1,Map2,Map3,Map4... But only Map2 is open in Excel..
Does anyone have a clue what I can do to solve this?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top