7,765
社区成员
发帖
与我相关
我的任务
分享
On Error GoTo errorhandler
With CommonDialog1
'get filename
.Filter = "S Files(*.S)|*.S|Bin Files(*.bin)|*.bin" '|Dat Files(*.dat)|*.dat|Document Files(*.txt;*.dat)|*.txt;*.dat|All Files(*.*)|*.*|"
.CancelError = True
.Flags = 6
.ShowOpen
'下面是对文件的正常处理
'......
errorhandler:
If Err.Number = cdlCancel Then Exit Sub
MsgBox "Runtime Error: " & Err.Number & "(Ox" & Hex(Err.Number) & ")" & vbCrLf & Err.Description
With DLG
.Filter = "*.HEX"
.ShowOpen
If .FileName = "" Then
Exit Sub
Else
'文件内容转存到ED2Flash()中
FillEd2Flash .FileName
End If
End With