Rijnsent
Well-known Member
- Joined
- Oct 17, 2005
- Messages
- 1,424
- Office Version
- 365
- Platform
- 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'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..