|
Private Sub CommandButton2_Click()
gcm.Hide
Dim TongMing As Boolean
工程名称 = gcm.TextBox1.Text
文件名称 = gcm.TextBox2.Text
LinShiWenJianMing = ActiveWorkbook.Name
Windows("材料预算.xls").Activate
If 文件名称 <> "" Then
With Application.FileSearch
.LookIn = ActiveWorkbook.Path
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) = ActiveWorkbook.Path & "\" & 文件名称 & ".xls" Then
MsgBox 文件名称 & ".xls" & "已存在!", vbExclamation
gcm.TextBox2.SetFocus
工程名称 = ""
文件名称 = ""
gcm.Show
Exit For
End If
Next i
End If
End With
End If
If 文件名称 = "" Then
Windows(LinShiWenJianMing).Activate
zk.Show
Else
文件名称 = ActiveWorkbook.Path & "\" & 文件名称 & ".xls"
End If
End Sub
|
|