hey @WS_Chai
its because returnText is NULL if no hidden sheets
you need to initialize returnText to “” first by adding returnText = “”
Dim returnText as string
returnText = ""
so now if theres no hidden sheets returnText will =“” instead of a NULL