Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

295
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!