我一直在网上搜索有关如何使用VBScript中的Open File Dialog打开文件的解决方案。有人能指出我走在正确的轨道上吗?
我的代码打开了Excel文件,但我希望它更具动态性,输入文件名可以更改而不是硬编码。
Set objExcel = CreateObject("Excel.Application")
objExcel.DisplayAlerts = 0
Set objShell = WScript.CreateObject("WScript.Shell")
path = objShell.CurrentDirectory
inFileName = "InputFile.xlsx"
inFilePath = path + "\" + inFileName
'Open target workbook
Set objWorkbook1 = objExcel.Workbooks.Open(inFilePath, False, True)
MsgBox "Reading Data from " & inFileName & vbNewLine, vbOkOnly + vbInformation, _
"Reading Data"