嗨嗨我必须写一个代码,如果用户点击进入输入框中的东西它应该继续进行.如果它没有输入任何值,它应该再次回到相同的问题.这已经我已经实现了,但我的问题是当用户点击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) 我一直在使用Daniel Klann编写的标准密码文本框(http://www.ozgrid.com/forum/showthread.php?t=72794)来隐藏密码输入.
主要问题是标准InputBox返回空字段并取消相同的方式.Application.InputBox但是能够False取消取消.
更新Daniel Klann的脚本以便与Application.InputBox我合作.怎么做?
这是丹尼尔的代码:
Option Explicit
'////////////////////////////////////////////////////////////////////
'Password masked inputbox
'Allows you to hide characters entered in a VBA Inputbox.
'
'Code written by Daniel Klann
'http://www.danielklann.com/
'March 2003
'// Kindly permitted to be amended
'// Amended by Ivan F Moala
'// http://www.xcelfiles.com
'// April 2003
'// Works for Xl2000+ due the AddressOf Operator
'////////////////////////////////////////////////////////////////////
'******************** CALL FROM FORM *********************************
' Dim pwd As String
'
' pwd …Run Code Online (Sandbox Code Playgroud)