' -- remove illegal filename characters - note ' dim is different in VBA than in VBS
' ───────────── Function stripBadFileChars(somestring) dim badchar, xyz 'As String in vba - not vbs badchar = ":;\|/*?" & chr(34) & chr(26) & vbCrLf & vbTab for xyz = 1 to len(badchar) somestring = StripCharsFrom(somestring, mid(badchar,xyz,1), "_") somestring = replace(somestring, "__", "_") next ' xyz somestring = replace(somestring, "__", "_") stripBadFileChars = somestring End Function ' stripBadFilChars ' ─────────────