Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

300
Visualizações
Recieving error in line "Set myshape = ActiveSheet.Shapes(Application.Caller)"

I'm using a small macro to add and delete Data field in pivotable. I have buttom assigned to Buttom, by pushining the buton I can call the field but by pushing twice it should be hidden, but it doesnt happend. One of the reason, pointed to Set myshape = ActiveSheet.Shapes(Application.Caller). Maybe I have another problems with code. Here's the code:

Sub Base_Salary()

Dim pt As PivotTable
Dim pf As PivotField
Dim sField As String
Dim myshape As Shape

Set pt = ActiveSheet.PivotTables(1)
Set myshape = ActiveSheet.Shapes(Application.Caller)
sField = myshape.TextFrame.Characters.Text

If pt.PivotFields(sField).Orientation = xlDataField Then
pt.PivotFields(sField).Orientation = xlHidden
myshape.Fill.ForeColor.Brightness = 0.5

Else 
pt.PivotFields(sField).Orientation = xlDataField
myshape.Fill.ForeColor.Brightness = 0

End If
End Sub
about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda