VBS 文件选择框,选择Excel文件

on error resume Next
Set objDialog=CreateObject("UserAccounts.CommonDialog")
objDialog.Filter="仅支持xls格式文件|*.xls"
objDialog.InitialDir="C:\"
intResult=objDialog.ShowOpen
If intResult=0 Then
Wscript.Quit
Else
If Right(objDialog.FileName,3)="xls" Then
Wscript.Echo objDialog.FileName
Else
Wscript.Echo "你选择的文件格式不支持"
Wscript.Quit
End If
End If
如果你對現在不滿意...否則你就好好學,因爲你還只是菜鳥...

浙公网安备 33010602011771号