I am curious. Maybe someone can help me out here.
I have a a macro that runs when a worksheet is selected or activated. Here is the VBA code ...
Here is my question ...
Upon sheet activation, the ranges called "photocol_v" and "photocol_x" assume the correct value based on the IF statement testing if Application.Build is greater than 16529. However the shape visibility for the two shapes called "photohelp1" and "photohelp2" always remain visible. Nothing happens when I select or activate the sheet. Just for grins and giggles, I placed the above code into a different private module with that worksheet and then the visibility runs as it is supposed to do.
What is going on with activation event of the worksheet that shape visibility is not working?
Regards,
Steve
I have a a macro that runs when a worksheet is selected or activated. Here is the VBA code ...
VBA Code:
Private Sub worksheet_activate()
Dim reprotect As Boolean
Dim c As Range
Dim i As Integer
Dim validc As Boolean
Dim xPTable As PivotTable
Dim xPFile1 As PivotField
Dim xPFile2 As PivotField
Dim xStr As String
'Set photo column visibility based on if Excel supports picture in cell
If Application.Build > 16529 Then
Range("photocol_v").Value = "v"
Range("photocol_x").Value = "v"
Sheet1.Shapes("photohelp1").visible = True
Sheet1.Shapes("photohelp2").visible = True
Else
Range("photocol_v").Value = "h"
Range("photocol_x").Value = "h"
Sheet1.Shapes("photohelp1").visible = False
Sheet1.Shapes("photohelp2").visible = False
End If
:
:
etc.
Here is my question ...
Upon sheet activation, the ranges called "photocol_v" and "photocol_x" assume the correct value based on the IF statement testing if Application.Build is greater than 16529. However the shape visibility for the two shapes called "photohelp1" and "photohelp2" always remain visible. Nothing happens when I select or activate the sheet. Just for grins and giggles, I placed the above code into a different private module with that worksheet and then the visibility runs as it is supposed to do.
What is going on with activation event of the worksheet that shape visibility is not working?
Regards,
Steve