0

How to save xls to another folder?

When I use "/" in save path it replaces then with ":". When I try to use "\" it saves the file with "\" in file name.

elerium115
  • 21
  • 3

1 Answers1

2

Use the Application.PathSeparator property and as an added bonus it'll be platform agnostic.

myPath = "myDirectory" & Application.PathSeparator & "mySubDirectory" & Application.PathSeparator & "myFileName"

Banjoe
  • 1,768
  • 12
  • 13
  • +1 If you get tired of typing `Aplication.PathSeparator` (oops) then assign it to a string variable with a shorter name, e.g. `Dim ps As String: ps = Application.PathSeparator`. Or even better: `Replace("myDirectory\mySubDirectory\myFileName","\",Application.PathSeparator)` to avoid all the annoying string concatenation. – Jean-François Corbett Aug 26 '11 at 07:48