8

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

Error when running Excel Add-In Macro from Excel Ribbon

Ribbon button not open original macro file


EDIT note 2: Here a screenshot:

enter image description here

10
  • 1
    per screen shot provided in the edit, this doesn't look like a duplicate. Voted reopen (as a side note after studying the screen shot I fail to imagine what could trigger heuristic for blocking of the question)
    – gnat
    Commented Jun 18, 2019 at 8:43
  • I even transformed the two single lines into code thinking that the Stack Overflow script might detect any code command. I also copied the text into word, closed the question and edited again from scratch pasting it. I put quotes in what I thought Stack Overflow might think is a command. As info this happens specially with VBA, since I did not have problems when posting python. This is my second VBA question I can not post.
    – JFerro
    Commented Jun 18, 2019 at 8:57
  • Could you provide the full text as a code block?
    – jonrsharpe
    Commented Jun 18, 2019 at 9:16
  • 3
    done in note 3, before the screenshot
    – JFerro
    Commented Jun 18, 2019 at 13:16
  • 1
    The error description (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 Commented Jun 18, 2019 at 15:55
  • 2
    @Zoe I believe its intended for where large portions of the post which should be formatted as code haven't been [formatted as code]. Not just for posts containing code :p Commented Jun 18, 2019 at 16:02
  • I still can not post the question. I don't understand how a question well elaborated (perhaps I am missing something here) can get negative punctuation.
    – JFerro
    Commented Jun 18, 2019 at 18:24
  • Votes are different on meta. Commented Jun 18, 2019 at 18:35
  • 1
    Difficult to see why anyone would dislike this post, though, seems to me that this sort of report is essential if the site is to iron out this type of boundary condition.
    – MandyShaw
    Commented Jun 19, 2019 at 5:40
  • 1
    ...and difficult to understand that the people posting questions dont see the need or the improvement in notifying WHERE exactly in the text Stack overflow detects code not properly formatted. (greying it out, notifying the line numbers, color-selecting the text etc)
    – JFerro
    Commented Jun 19, 2019 at 8:38

0

You must log in to answer this question.

Browse other questions tagged .