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 – Get Sheet Custom Property

Retrieves the value of a custom property from the specified Excel.Worksheet.

The function iterates through the CustomProperties collection of the worksheet to locate the specified property by name. If found, its value is returned. If not found or an error occurs, an empty string is returned and the error is displayed using ShowMessageBox

VB
    Public Function xlGetSheetCustomProperty(wsSheet As Worksheet,               
                                             PropertyName As String) As String

        Dim szAttributeValue As String = String.Empty

        Try
            Dim customProperties As CustomProperties = wsSheet.CustomProperties

            ' Check property and return value
            For Each Prop As CustomProperty In customProperties
                If Prop.Name = PropertyName Then
                    szAttributeValue = Prop.Value.ToString
                    Exit For
                End If
            Next

        Catch ex As Exception
            ShowMessageBox($"Error: {ex.Message}")
        End Try

        Return szAttributeValue
    End Function

Posted by ipercube


© 2026 Ipercube Design