0

I am using VBA and trying to save an excel workbook like this

ActiveWorkbook.SaveAs C:\SomeDir\Filename

However, my filename contains a "/" for example: "A3/File" (No, I cannot change that), which causes saving to fail because the slash is read as being part of the path and not part of the file name so it points to a directory that does not exist.

Is there anyway to save that file without having to remove the slash?

BigBen
  • 46,229
  • 7
  • 24
  • 40
krise
  • 485
  • 1
  • 10
  • 22
  • 6
    `/` is not a valid character in a filename... https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names – BigBen Apr 09 '20 at 12:41
  • maybe some MAC? – HTH Apr 09 '20 at 13:09
  • 1
    Why can't you change that? – Tim Williams Apr 09 '20 at 16:20
  • Thanks for the answers, the reason I said I cannot change it is because my boss (who is not an IT Person) just told me to give certain names to the files. So I just really wanted to not change the names if that was possible. However, since as Big Ben pointed out it is not possible to name the file that I told him I needed to change it so everything is fine now, thanks guys ! – krise Apr 10 '20 at 14:29

0 Answers0