Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am trying to make an application in vba for implementing a search through photoshop layers. I get the error at the line between ***. I searched all over google and found nothing, also in some photoshop scripting manuals for VBA where the exact line is state as an example. Please help me, it's driveing me mad. Also, hope it's in the right section.
XML
Runtime error 438 Object doesn't support this property or method

<pre lang="vb">For Item = 1 To objActiveDocSecondary.Layers.Count
            If objActiveDocSecondary.Layers(Item).TypeName = &quot;LayerSet&quot; Then
                If InStr(UCase(objActiveDocSecondary.Layers(Item).Name), WordToSearch) Then
                    setVisibilityAllLayers (False)
                    objActiveDocSecondary.ActiveLayer = objActiveDocSecondary.Layers(Item)
                    Exit For
                End If
            Call parseLayersSearch(objActiveDocSecondary.Layers(Item))
            Else
                layerName = objActiveDocSecondary.Layers(Item).Name
                If InStr(UCase(objActiveDocSecondary.Layers(Item).Name), WordToSearch) Then
                    setVisibilityAllLayers (False)
                  ********************************************************************************
                    objActiveDocSecondary.ActiveLayer = objActiveDocSecondary.Layers(Item)
                  ***************************************************************************
                    Exit For
                End If
            End If
        Next Item</pre>
Posted

1 solution

Managed to solve my problem, it was that I was refering to the LayerSet not to the ActiveDocument. The correct line is:

objActiveDoc.ActiveLayer = objActiveDocSecondary.Layers(Item)

Thanks anyway to those who took time to have a look at my issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900