Я использовал 32-битный MS Excel, и этот макрос работал нормально.Теперь я перешел на 64-битный Excel 2016 и макрос не работает.В чем проблема с этим?Есть ли решение, чтобы заставить его работать как с 32-битной, так и с 64-битной версиями?
Sub Rectangle_Clicked()
Button = Application.Caller
Rectangle_Toggle (Button)
End Sub
Sub Rectangle_Toggle(Button As Variant)
With Application.ActiveSheet.Shapes(Button)
'Transparency of the shape 1 = transparent, 0 = solid
.Fill.Transparency = 1
'Hides the cell's value
Range(.TopLeftCell.Address).Font.Color = Range(.TopLeftCell.Address).Interior.Color
If .TextFrame.Characters.Text = Chr$(252) Then
.TextFrame.Characters.Text = ""
.Fill.ForeColor.RGB = RGB(255, 255, 255)
Range(.TopLeftCell.Address).Value = False
Else
.TextFrame.Characters.Text = Chr$(252)
.Fill.ForeColor.RGB = RGB(46, 208, 80) '(50, 195, 50) <-- change your color here
Range(.TopLeftCell.Address).Value = True
End If
End With
End Sub
Я получаю сообщение об ошибке «Не удается найти проект в библиотеке».И VB выделяет кнопку слова в Button = Application.Caller