On Error GoTo line1        
UnpackFold = UnzipFold(StrFilename)
Put the unpackfold = line before the On error line