The user defined function always returns 0 if it has the module name as prefix

Bob Qiu 0 Reputation points
2025-02-26T08:57:29.9166667+00:00
Public Function QNA_SR( _
    Optional p1, Optional p2, Optional p3, Optional p4, Optional p5, _
    Optional p6, Optional p7, Optional p8, Optional p9, Optional p10, _
    Optional p11, Optional p12, Optional p13, Optional p14, Optional p15, _
    Optional p16, Optional p17, Optional p18, Optional p19, Optional p20, _
    Optional p21, Optional p22, Optional p23, Optional p24, Optional p25, _
    Optional p26, Optional p27, Optional p28, Optional p29) As Variant
    On Error Resume Next
    QNA_SR = 12    
End Function

And above function is inside module with name Sabc. If we input =@Sabc.QNA_SR() in cell, the cell always displays 0. If we input =@QNA_SR(), the cell can display 12 correctly. I also have tried to set breakpoint in this function, but =@Sabc.QNA_SR() cannot trigger the breakpoint.

It only happens in one machine which is installed with office 2024. All other office can work well for =@Sabc.QNA_SR()User's image

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,295 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.