Skip to content

Access error 5152 and how to avoid it

If you get Error #5152 when running code that saves a file, check whether there is a date formatted with slashes (2/15/2010) in the file name.

Slashes are not permitted in file names, so you will get this error when trying to save a file including a date in this format.

To avoid this error, format a date used in a file name with a format that uses dashes (2-15-2010 or 15-Feb-2010) instead of slashes.

About this author

Office 2024 - all you need to know. Facts & prices for the new Microsoft Office. Do you need it?

Microsoft Office upcoming support end date checklist.