0
如何將xls保存到其他文件夾?Office 2011 for Mac中的Workbook.SaveAs()到不同的文件夾
當我在保存路徑中使用「/」時,它用「:」代替。當我嘗試使用「\」時,它會在文件名中保存帶有「\」的文件。
如何將xls保存到其他文件夾?Office 2011 for Mac中的Workbook.SaveAs()到不同的文件夾
當我在保存路徑中使用「/」時,它用「:」代替。當我嘗試使用「\」時,它會在文件名中保存帶有「\」的文件。
使用Application.PathSeparator屬性,並作爲額外的獎勵,它將是平臺不可知的。
myPath = "myDirectory" & Application.PathSeparator & "mySubDirectory" & Application.PathSeparator & "myFileName"
+1有用的想法! – Fionnuala
+1如果您厭倦了鍵入'Aplication.PathSeparator'(oops),則將其分配給一個名稱較短的字符串變量,例如Dim ps As String:ps = Application.PathSeparator'。或者更好:'替換(「myDirectory \ mySubDirectory \ myFileName」,「\」,Application.PathSeparator)'以避免所有煩人的字符串連接。 –