Skip to sidebar Skip to content
Ipercube Technical
Jack of all trades, master of none
Date: Time: - Stardate:
Welcome, Log in by clicking  Here!
SS64
MDN
Stack
Code
GitHub
Wiki
Convert
V Studio
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions
Ipercube Technical
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions

Sheet Custom Property – Sheet Custom Property Exists

Checks whether a custom property with the specified name exists in a given Excel.CustomProperties collection.

Since direct access by property name is not supported, the function iterates through the collection to find a match. Returns False if an exception occurs or if the property is not found.

VB
    Public Function xlPropertyExists(customProperties As CustomProperties, 
                                     propertyName As String) As Boolean

        Dim propToCheck As CustomProperty = Nothing

        'Check if exists - must enumerate to find the property, direct access by name not working
        Try
            For Each cp As CustomProperty In customProperties
                If cp.Name = propertyName Then
                    propToCheck = cp
                    Exit For
                End If
            Next

            If propToCheck IsNot Nothing Then Return True
        Catch ex As Exception
            Return False
        End Try

        Return False
    End Function

Posted by ipercube


© 2026 Ipercube Design