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 Properties To CSV String

Converts the custom properties of an Excel worksheet into a CSV-formatted string.

VB
    Public Function xlGetSheetCustomPropertiesToCSVstring(sheet As Worksheet, 
                                                          Optional Separator As String = ";") As String

        If sheet Is Nothing Then Throw New ArgumentNullException(NameOf(sheet))

        Dim sb As New System.Text.StringBuilder()
        Try
            Dim props As Object = sheet.CustomProperties
            If props IsNot Nothing Then
                For i As Integer = 1 To props.Count
                    Dim prop As CustomProperty = CType(props.Item(i), CustomProperty)
                    sb.AppendLine($"{prop.Name}{Separator}{prop.Value}")
                Next
            End If
        Catch ex As Exception
            ' Optionally log the error or rethrow
            Throw New Exception("Error reading CustomProperties: " & ex.Message, ex)
        End Try
        Return sb.ToString()
    End Function

Posted by ipercube


© 2026 Ipercube Design