First: have you changed
Set c2 = 32000
into
c2 = 32000
As c2 is declared as Integer (it would be wiser to declare it as long) it cannot be Set. You can Set only object variables.

so:
Public Function Main_HideRows(ByVal rng As Range, tgbtn As ToggleButton)

Dim sht As Excel.Worksheet
Dim c As Integer
Dim c2 As Integer

Set sht = Arkusz1
'Set
c2 = 32000
'...
if it does not help, press Debug when code stops, chech which code line is highlited in yellow and let us know.