How to get row number of clicked button when Application.Caller just returns an Error?
<p>There are many questions like mine and I just tried out the solution mentioned in many places, for example <a href="https://stackoverflow.com/questions/6242605/excel-vba-getting-row-of-clicked-button">here</a>. But for me it just returns the error "Run-time error '1004': Unable to get the Buttons property of the worksheet class" when I enter the following code:</p>

<pre><code>Sub Mainscoresheet() 
     ' Mainlineup Macro
    Dim b As Object, RowNumber As Integer 
    Set b = ActiveSheet.Buttons(Application.Caller) 'here I get the error
    With b.TopLeftCell 
        RowNumber = .Row
    End With 
    MsgBox "Row Number " &amp; RowNumber 
End Sub
</code></pre>

<p>Does anyone know another solution which would fix my problem?
If you need any further information, please feel free to ask.
Thanks in advance!</p>

<p>Kind regards,
Julia</p>