Is it possible to override that error message? I have the feeling something changed in the way the content of the questions are checked, it is the second time I gave up and did not post a question after trying to tweak the text of the question, Stack overflow would not let me post because "code not properly formatted is included in the question". Reality: the question does not include code not formatted as such.
Suggestion: notify WHERE exactly in the text Stack Overflow detects code not properly formatted. (greying it out, notifying the line numbers or color-selecting the text, you name it...)
My question definitely did not include code not formatted as code.
It is frustrating that Stack Overflow does not tell you where the error is detected.
Please check the code snippets to detect code and make it still possible to post the question. This is clearly a bug.
The problem might be that the questions giving errors do not get posted to Stack Overflow, so they might not know where the checking fails.
EDIT note 1: This question was marked as duplicate. It is not. In the above mentioned duplicate the answer is: "I removed all formatting and the system allowed me to post the same body:"
I dont have ANY text formatting to remove in my question, only code and text, as it is seen in the screenshot added in edit note 2.
NOTE 3: After one of the answers here the full text as a block
Text as a full block:
I am trying to add three buttons to a personal ribbon in excel.
For that I created four macros like this:
Sub ribbon_send_the_email() If isEPOfile = True Then Call Mail_Workbook_with_Outlook End If End Sub Function isEPOfile() As Boolean If InStr(ThisWorkbook.FullName, "EPO") Then isEPOfile = True Else isEPOfile = False End If End Function
So the first "ribbon_send_the_mail" checks if the workbook that is opened contains the word EPO by calling the function and if so runs the macro "Mail_Workbook_with_Outlook" which is in a module of the workbook.
Then I go to File / options / customize ribbon and I add a button to a new ribbon associating it with a macro called:
'EPO2019-6wk23.xlsm'!RIBBON_fast.ribbon_runform
The subroutine ribbon_send_the_email is in a module called RIBBON_fast
All looks good.
but then when clicking the button the follwing error appears:
Cannot run the macro 'EPO2019-6wk23.xlsm'!RIBBON_fast.ribbon_runform The macro may not be
available in this workbook or all macros may be disabled.
I find very tricky adding buttons to the ribbon.
Notes: a) The reason for checking the name of the file is because the ribbons are going to be there always, and if I open any other file I want to avoid the error when the excel file tries to run a macro that is not part of the workbook
b) assigning a shortkey might be an option but for my needs the most elegant solution is a button. Then I can pass the workbook to colleagues who might not be asking all the time what was the shortcut again.
c) I observed that when listing the macros in file/options/customize ribbon sometimes the names of the macros appear preceded by the workbook name (in this case EPO2019-6wk23.xlsm) and other times dont. Why? what are the implications?
Sources consulted:
Call Excel Macro from Ribbon Button
Add Macro to Excel Ribbon in Add-In
EDIT note 2: Here a screenshot:
Your post appears to contain code
, assuming that's the actual error) almost has to be a bug on its own. Especially on a site about coding