諸位大大"
(試算表.vbs)
Dim f1,fbn
f1="試算表"
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(f1 & ".vbs")
dim n
n = fso.GetParentFolderName(f.path)
Dim objXLApp
set objXLApp = WScript.CreateObject("Excel.Application")
objXLApp.Visible = True
objXLApp.Workbooks.Open (n & "\" & f1 & ".xls")
Set objXLApp = Nothing
Set fso = Nothing
WScript.Quit
可有辦法不用 f1="試算表"
讓利用程式內容自動得到檔案本身filename
如fullname1=self filename
謝謝指導作者: yangjie 時間: 2017-12-10 23:46