Workbook events not working but Application.EnableEvents = True!!!

pobo1234

New Member
Joined
Jan 26, 2017
Messages
12
Hi
I've got a major issue on a machine where none of the ThisWorkbook or worksheet events are triggering such as Workbook_SheetBeforeDoubleClick are working.
I have checked the setting for Application.EnableEvents and that is definitely true. I think an Excel dll or setting something is corrupted but can't fix it. I've tried re-setting the Excel registry settings, repairing MS Office and deleting all .exd files but none of this has worked.

Please has anyone in the forum got any ideas on what I can try or do to resolve this issue?


Many thanks

Pobo1234
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I've never heard of this happening. Are you sure you have setup the events properly and that, if turned off, they're turned back on? sample code?
 
Upvote 0
I get the same problem if I open a fresh workbook and put a simple msgbox "hello" piece of code in the thisworkbook double click event procedure. When I double click a worksheet nothing happens. In fact none of the workbook events are trigger by any of the events that they should be.
 
Upvote 0
Don't mean to be insulting - but are you setting up the events properly? That's why I asked for a sample..
They're in the right module, they have the correct headers..
and when you type ?Application.EnableEvents in the Immediate Window, it returns True?
 
Upvote 0
You're not be insulting but the answer is yes to all of the above. I did state in my first post that I have checked the value of application.enableevents. What we are looking at here is some sort of corruption. Does anyone know what library controls the workbook events?
 
Upvote 0
Yes, I know you mentioned it all earlier, but since I'm unfamiliar with you and your skill set, you could be saying things you don't really understand.. it's happened before (this month, as a matter of fact!). I will link this to the MVPs since most aren't going to see it anymore. Some of them are more experienced in the background of Excel.
 
Upvote 0
You're not be insulting but the answer is yes to all of the above. I did state in my first post that I have checked the value of application.enableevents. What we are looking at here is some sort of corruption. Does anyone know what library controls the workbook events?

Some additional checks to understand the problem better and rule out other possible causes....

1. Are you able to run non-event macros in the same workbook?

2. Please post the double click code example (as Tracy asked).

3. If the code is in your ThisWorkbook module, the declaration should look like this...

Code:
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)

Sometimes people paste code examples into ThisWorkbook that were intended to work in Sheet code modules with declarations like...
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

4. Make sure you have an Option Explicit statement at the top of your ThisWorkbook module, then compile the VBA project.

5. Try saving the workbook with the test event code and testing the workbook on another computer.

6. Uninstall all Excel Add-Ins including COM Add-Ins before testing.

7. If that computer/ user profile has a Personal.xlsb or other files in the XLSTART folder, temporarily move those to another folder before testing.

8. In the VB Editor, check for Missing library references. Tools > References > look for references that start with "MISSING: "
 
Upvote 0
I'd also suggest a reboot of the problem machine just in case, then start Excel in Safe mode by holding down the Ctrl key while starting the application. Then run Jerry's tests.
 
Upvote 0
I get the same problem if I open a fresh workbook and put a simple msgbox "hello" piece of code in the thisworkbook double click event procedure. When I double click a worksheet nothing happens. In fact none of the workbook events are trigger by any of the events that they should be.

1. Are you able to run non-event macros in the same workbook?

6. Uninstall all Excel Add-Ins including COM Add-Ins before testing.

7. If that computer/ user profile has a Personal.xlsb or other files in the XLSTART folder, temporarily move those to another folder before testing.

8. In the VB Editor, check for Missing library references. Tools > References > look for references that start with "MISSING: "

I'd alter Jerry's trouble-shooting sequence a bit. Based on your quote I cited, then Jerry's #1 will tell you whether macro security is what's getting in the way.

If macro security isn't getting in your way then perhaps something else is intercepting events first? I know I write add-ins that intercept application-level events, so it's possible that another add-in is doing this.
 
Upvote 0
Some additional checks to understand the problem better and rule out other possible causes....

1. Are you able to run non-event macros in the same workbook?

2. Please post the double click code example (as Tracy asked).

3. If the code is in your ThisWorkbook module, the declaration should look like this...

Code:
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)

Sometimes people paste code examples into ThisWorkbook that were intended to work in Sheet code modules with declarations like...
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

4. Make sure you have an Option Explicit statement at the top of your ThisWorkbook module, then compile the VBA project.

5. Try saving the workbook with the test event code and testing the workbook on another computer.

6. Uninstall all Excel Add-Ins including COM Add-Ins before testing.

7. If that computer/ user profile has a Personal.xlsb or other files in the XLSTART folder, temporarily move those to another folder before testing.

8. In the VB Editor, check for Missing library references. Tools > References > look for references that start with "MISSING: "

Hi Jerry

Thanks for your response

1. Are you able to run non-event macros in the same workbook? Yes

5. Try saving the workbook with the test event code and testing the workbook on another computer. - It does work on other PCs so it seems th problem is PC specific

6. Uninstall all Excel Add-Ins including COM Add-Ins before testing. - I had tried this but had left one Addin, a Reuters addin installed. On uninstalling this I was able to get the events working!!

Thanks for help again - resolved :-)
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

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