我用VB做了一个上位机,将数据保存到EXCEL中~现在我EXCEL自动保存的程序如下:
Private Sub Command4_Click()
Timer2.Enabled = True
j = j + 1
x1sheet.Cells(j + 1, 4) = temp1_show.Text
x1sheet.Cells(j + 1, 3) = Time$
x1sheet.Cells(j + 1, 5) = temp2_show.Text
x1sheet.Cells(j + 1, 6) = temp3_show.Text
x1sheet.Cells(j + 1, 7) = temp4_show.Text
x1sheet.Cells(j + 1, 8) = temp5_show.Text
x1sheet.Cells(j + 1, 9) = temp6_show.Text
x1sheet.Cells(j + 1, 1) = Format(Date, "Long Date")
x1book.saveas ("C:\Users\lenovo\Desktop")
End Sub
就是每隔一段时间将EXCEL保存到桌面上,我设置的是30秒,但是每次到30秒的时候他就会提示桌面上有一个相同的文件,是否覆盖,请问我怎么改就是让它默认覆盖呢?请大神指导下