下面是我一直使用的一段程序
没有什么大问题
但是每次存储的时候,EXCEL都弹出一个对话框“在当前位置发现已经存在名位‘RESUME.XLW’的文件,是否替换为现有的‘RESUME.XLW’?”
要点击“是”,才能进行存储
调试发现是运行到这条语句时弹出来的: Excel_App.Save
请教各位,有什么办法不弹出该对话框吗?谢谢了
Dim tem_name As String
Dim Row As Integer
Dim Col As Integer
Dim i, j As Integer
On Error Resume Next
Set Excel_App = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Set Excel_App = CreateObject("Excel.Application")
End If
Err.Clear
Excel_App.Caption = "Tab"
Excel_App.Workbooks.ADD
Excel_App.Visible = True
Set Excel_sheet = Excel_App.ActiveSheet
Excel_sheet.Range("A1:N100").ClearContents
For i = 0 To MSHF.Rows - 1
For j = 0 To MSHF.Cols - 1
DoEvents
MSHF.Col = j
MSHF.Row = i
Excel_sheet.Cells(i + 1, j + 1) = MSHF.Text
Next j
Next i
Excel_App.Columns.AutoFit
Excel_App.Save
Excel_App.ActiveWorkbook.Close
Set Excel_sheet = Nothing
Excel_App.Quit
Set Excel_App = Nothing