chdir語法
chdir path
更改預設的資料夾位置
(curdir為現時所在資料夾)
例如
Sub ex1()
a = ThisWorkbook.Path
b = Application.Path
Range("a1") = a
Range("a2") = b
MsgBox "d:\abc" & CurDir
ChDir "c:\aaa"
'MsgBox "e:\def" & CurDir
End Sub
-===============================
sub ex2()
chdir"a:\"===============(指在a的地址)
workbooks.open filename:="ex.els"=======(轉移到c內)
end sub
               (
geocities.com/hk/bokuwa_dikikodesu)                   (
geocities.com/hk)