vba remove remove ileagal file name characters
Private Function ValidWBName(Arg As String) As String Dim RegEx As Object Set RegEx = CreateObject("VBScript.RegExp") With RegEx .Pattern = "[\\/:\*\?""<>\|]" .Global = True ValidWBName = .Replace(Arg, "") End With End Function
Source: www.mrexcel.com