0

I've created a VBA Add-In which install itself as Add-In by Addins.Installed property. But unknowingly I added ThisWorkBook.Close after referred an answer. Now whenever I open this xlam file it opens and closes immediately. I have MS Excel 2016. How can I resolve it?

Community
  • 1
  • 1
Dhay
  • 585
  • 7
  • 29
  • 1
    Set macros security to high, disabling all macros? And open using File/Open. Then remove the close code. – vacip Apr 28 '17 at 10:29
  • 1
    Disable all macros in the trust center and then open it. – Rory Apr 28 '17 at 10:30
  • Sorry. Didn't work – Dhay Apr 28 '17 at 11:05
  • Did you also disable all add-ins? – Rory Apr 28 '17 at 11:20
  • 1
    Have you tried opening from another application, say Access, like this? `Set x = New Excel.Application: x.EnableEvents = False: x.Workbooks.Open ("AddIn.xlam"): x.Visible = True` – Nathan_Sav Apr 28 '17 at 11:21
  • Have to install Access. Will try now. – Dhay Apr 28 '17 at 11:27
  • or word VBA any office app where you can load excels vba library – Nathan_Sav Apr 28 '17 at 11:31
  • Thank you for vacip, Rory, Nathan_Sav. You are all gave superior suggestions. I resolved it in a dirty way by removing (uncheck) from Add-ins list, move add-in to somewhere, Close and Open Add-ins list and delete from list, again install it manually by Browse even though it does not seem best way. – Dhay Apr 28 '17 at 12:25
  • 1
    As an extra to @vacip - save the current security setting in a `long` variable: `CurSetting = Application.AutomationSecurity`, change the setting: `Application.AutomationSecurity = msoAutomationSecurityForceDisable`, open your workbook and then `Application.AutomationSecurity = CurSetting` – Darren Bartrup-Cook Apr 28 '17 at 12:43

0 Answers0