Bug/Issue: if in trust center > macro set 'Enable VBA macros', it will fail to run VBA (error 1004)

Occasional Visitor

In Excel , in trust center > macro setting: if default clicked Enable VBA macros.

When I open the excel, it will fail to run VBA with runtime error 1004. [VBA run-time error '1004' Method 'Worksheets' of object '_Global' failed] and the excel is still in 'Protected View'

**But the VBA work fine if I have set 'Disable VBA macros with notification' in Macro >setting and click 'Enable Editing' when I open the excel


I have created a testing excel below, you could download it and try when you have time. https://drive.google.com/file/d/1cP7e4uofhDcH7nOyj52GS3KaBO09vhec/view?usp=sharing

**It is work with placing the excel in a trusted location, but is there any other way?

You could find more information in below stackoverflow discussion.



0 Replies