I am looking to either prevent a workbook from opening, or forcing a close, if a required add-in is not installed on the user's computer. I have a series of workbooks that contain data, and all their functionality is controlled from an add-in.
I have tried to place the following code in several different routines, including Workbook_Open, Workbook_Activate, and in other modules where it is triggered by an event or command button. I continually get a run-time error 1004 when it tries to close the workbook. The following code does a good job of recognizing when the add-in is installed or not. The trouble I am having is focused solely on forcing a close.
Instead of ActiveWorkbook.Close I have also tried ThisWorkbook.Close with the same results.
Does anybody have some insight on this? Or previous experience to share? Or other techniques to consider for disabling the file?
Thanks!
Bookmarks