如何獲取Excel的環(huán)境參數(shù):
Debug.Print Application.AltStartupPath '傳回取代啟動文件夾的名稱 Debug.Print ActiveWorkbook.Path '傳回目前工作簿的路徑(檔案未存盤時傳回空字符串) Debug.Print ActiveWorkbook.FullName '現(xiàn)用目前工作簿的路徑及文件名稱(檔案未存盤時只傳回暫存盤名) Debug.Print Application.NetworkTemplatesPath '傳回存儲模板所在的網(wǎng)絡路徑,如果指定的網(wǎng)絡路徑不存在,本屬性將傳回一空字符串 Debug.Print Application.TemplatesPath '傳回存儲范本所在的區(qū)域路徑 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 |
|站長郵箱|小黑屋|手機版|Office中國/Access中國
( 粵ICP備10043721號-1 )
GMT+8, 2025-7-13 08:26 , Processed in 0.063032 second(s), 16 queries .
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc.