嗨嗨我必须写一个代码,如果用户点击进入输入框中的东西它应该继续进行.如果它没有输入任何值,它应该再次回到相同的问题.这已经我已经实现了,但我的问题是当用户点击CANCEl时,它再次询问相同的问题,而它应该退出.我是VB Script的新手.Plz帮助我如何处理这些按钮?下面是我现有的代码
Do while x=0
strAnswer = InputBox("Please enter the file extension * For all files:", _
"File Extension")
If strAnswer = "" Then
MsgBox"You must enter an extension."
Else
a=strAnswer
Exit Do
End If
Loop
intRow = 2
'strFileName = "T:\public\Madhumita\New.xls"
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
'objWorkbook.SaveAs(strFileName)
objExcel.Cells(1, 1).Value = "Folder"
objExcel.Cells(1, 2).Value = "File Name"
objStartFolder = "T:\public\Madhumita\Madhu"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files
If a="*" …Run Code Online (Sandbox Code Playgroud) vbscript ×1