Board logo

標題: [分享] Excel 內建的預設"路徑"函數整理 [打印本頁]

作者: Min    時間: 2010-5-3 20:47     標題: Excel 內建的預設"路徑"函數整理

Sub EnvironHelp()
    Debug.Print Application.AltStartupPath        '傳回取代啟動資料夾的名稱
    Debug.Print ActiveWorkbook.Path               '傳回目前工作簿的路徑(檔案未存檔時傳回空字串)
    Debug.Print ActiveWorkbook.FullName           '現用目前工作簿的路徑及檔案名稱(檔案未存檔時只傳回暫存檔名)
    Debug.Print Application.NetworkTemplatesPath  '傳回儲存範本所在的網路路徑,如果指定的網路路徑不存在,本屬性將傳回一空字串
    Debug.Print Application.TemplatesPath         '傳回儲存範本所在的區域路徑
    Debug.Print Application.Path                  '傳回Excel程式完整路徑
    Debug.Print Application.DefaultFilePath       '傳回或者設定 Microsoft Excel 開啟檔案時使用的預設路徑
    Debug.Print Application.StartupPath           '傳回啟動資料夾的完整路徑
    Debug.Print Application.LibraryPath           '傳回程式庫資料夾的路徑
    Debug.Print Application.UserLibraryPath       '傳回使用者電腦上 COM 增益集安裝位置的路徑(2000以上)
    Debug.Print Application.PathSeparator         '傳回路徑分隔符號
    Debug.Print CurDir                            '傳回目前的路徑(開啟舊檔時線市的路徑)
End Sub




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)