I am trying to create a custom property in excel and then get its value. This is normal when I do not use an empty string, i.e. "" . When I use an empty string, I get this error:
Run-time error '7': Out of memory
Here is the code I'm using:
Sub proptest() Dim cprop As CustomProperty Dim sht As Worksheet Set sht = ThisWorkbook.Sheets("control") sht.CustomProperties.Add "path", "" For Each cprop In ThisWorkbook.Sheets("control").CustomProperties If cprop.Name = "path" Then Debug.Print cprop.Value End If Next End Sub
The code does not work Debug.Print cprop.value . Should I set the property "" ?
source share