- 帖子
- 258
- 主題
- 77
- 精華
- 0
- 積分
- 385
- 點名
- 0
- 作業系統
- Win7
- 軟體版本
- Office2010
- 閱讀權限
- 20
- 性別
- 男
- 來自
- Taiwan
- 註冊時間
- 2010-8-8
- 最後登錄
- 2021-1-25
|
3#
發表於 2010-11-4 23:19
| 只看該作者
回復 2# oobird
Sub Main()
Dim objXLApp
Dim objXLBook
Dim fso, f As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("登錄.xls")
Dim n
n = fso.GetParentFolderName(f.Path)
Set objXLApp = CreateObject("Excel.Application")
objXLApp.Visible = True
Set objXLBook = objXLApp.Workbooks.Open(n & "\登錄.xls")
Set objXLBook = Nothing
' objXLApp.Quit
Set objXLApp = Nothing
Set fso = Nothing
Set n = Nothing
Set f = Nothing
End Sub
請教大大
欲將此vb轉為*.exe檔
夢想*.exe中的*可取為任何字元之後,"登錄"若為變數am am=*
則*.exe與*.xls只要取同檔名即可
故應如何取得本身開檔*.exe的* |
|