Workbook.SaveAs() to different folder in Office 20

2019-08-27 19:45发布

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.

1条回答
Rolldiameter
2楼-- · 2019-08-27 20:19

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

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

查看更多
登录 后发表回答