Would you be able to attach the workbook?
Are you selecting a shape in your macro? If so, try selecting the worksheet containing the shape first.
So sorry but I see below descriptions..
Sub UnHighlightAll(clickshape As Shape)
Application.ScreenUpdating = False
Dim numshapes As Integer
Dim shp As Shape
Dim shapename As String
Dim clickshapenum As Integer
Sheets(Introduction).Unprotect (Sanofi)
numshapes = Sheets(Introduction).Range(CA1).End(xlDown).Row
Dim levelshape(0 To 30) As Integer
For i = 1 To numshapes
Enter = 0
If Sheets(Introduction).Range(CA & i).Value =
https://urldefense.proofpoint.com/v...2JXxnELuZ1tRl3KLY50JLtorgQlU4BQO4UQiBP5VgM&e= Then
clickshapenum = i
levelshape(i) = Range(level)(i)
Exit For
End If
levelshape(i) = Range(level)(i)
Next i
For i = 1 To numshapes
HideBaadmai = 0
shapename = Sheets(Introduction).Range(CA & i).Value
Set shp = Sheets(Introduction).Shapes( & shapename)
If shp.Visible = False Then
HideBaadmai = 1
shp.Visible = True
End If
shp.Select
If clickshapenum = 0 Then
If Left(
https://urldefense.proofpoint.com/v...2JXxnELuZ1tRl3KLY50JLtorgQlU4BQO4UQiBP5VgM&e= , 7) = TextBox Or
https://urldefense.proofpoint.com/v...2JXxnELuZ1tRl3KLY50JLtorgQlU4BQO4UQiBP5VgM&e= = Rectangle 286 Or
https://urldefense.proofpoint.com/v...2JXxnELuZ1tRl3KLY50JLtorgQlU4BQO4UQiBP5VgM&e= = Rectangle 294 Then
levelshape(clickshapenum) = 3
Else
levelshape(clickshapenum) = 2
End If
End If
If Range(level)(i) = levelshape(clickshapenum) Then
If Range(level)(i) = 2 Then
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(165, 166, 203)
Selection.ShapeRange.TextFrame2.TextRange.Font.Fill.ForeColor.ObjectThemeColor = msoThemeColorBackground1
Else
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(122, 123, 178)
Selection.ShapeRange.TextFrame2.TextRange.Font.Fill.ForeColor.ObjectThemeColor = msoThemeColorBackground1
End If
End If
If HideBaadmai = 1 Then shp.Visible = False
Next i
End Sub