My program is loading/opening Microsoft Excel file file contains macros and that is why the following dialog appears:
Microsoft Excel Security Notice Microsoft has blocked macros from running because the source of this file is untrusted. File Path: Book1 Microsoft has blocked macros from running because the source of this file is untrusted. More information
I am using Office 2016 on Windows 10, but such dialog has been for a long time.
The very strange thing is that up to now, e.g. during Summer of 2022, this dialog has the button 'Enable Macros'. Now the dialog is the same, but the only button has the text 'Disable Macros'.
Such dialog-button combination is beyond comprehension. From the one side the dialog says that MS has blocked macros. From the other side there is no more button 'Enable Macros', but there is 'Disable Macros' which can do nothing, because Microsoft has already blocked (disabled?) macros?
Maybe 'disabled' and 'blocked' are different things?
The main question is - how can I enable macros, if the security dialog does not provide the button to enable macros?
While researching the situation I found https://learn.microsoft.com/lv-lv/DeployOffice/security/internet-macros-blocked about possible changed of macro security handling. Microsoft is introducing these changes 2022/2023, maybe this can explain while 'Enable macros' was available during Summer 2022, but 'Disable macros' is available now (Spring 2023).
Additional information:
I am using xls (not xlsx file), this file has no 'Mark from Web' in 'File-Properties-General', my computer is running in Windows domain (I don't have more information). The strange thing is that I don't see any macro content in 'Developer-Macros' in my xls file. So, there is no anything to protect from. I am now guessing that my xls file contains some Excel 4 macros and that I should enable special regime to see them in Office 2016 (or newer) Excels. Currently, the situation is very confusing.
Additional information 2:
My file has nothing under 'Developer - Macros', but it has lot of VBA objects under 'Developer - Visual Basic' - lot of empty 'Microsoft Excel Objects' for each of the sheets and one large module in the 'Modules'. This module contains lot of functions. I am guessing that these VBA objects are something different from Macros. These VBA functions can be called from the calling applications that is doing some manipulation on this Excel file. So - no Macros, but VBA objects, that may explain strange behavior possibly?
Additional information 3:
This article https://www.ablebits.com/office-addins-blog/advantages-custom-functions-excel/ is very good explanation of differences among VBA functions and macros - the first ones are function
, the second ones - sub
. The first ones can act inside cell only, the the second ones - can modify blocks of cells. It appears - I have checked - that my file contains VBA functions only, no VBA macros. So, this is even more stranger - why Microsoft is reporting that it is blocking macros, if there are no macros at all?