谁能帮我看看我这个程序应该加点什么才能保存Excel呢,最好可以帮我写出来,感激不尽!!
Private Sub Command1_Click()n = Val(Text5.Text)
d = Val(Text6.Text)
vd = 3.14 / 60 * n * d * 0.1 * 0.1 * 0.1
Text2.Text = vd
If IsNumeric(Text2.Text) = True And Val(Text2.Text) <= 70 Then
Text2.Text = Round(Val(Text2.Text), 2)
Else: MsgBox "数值不符合"
End If
If Dir("E:\VB程序(千万别动)\excel.bz") = "" Then '
Set xlApp = CreateObject("Excel.Application") '
xlApp.Visible = True '
Set xlBook = xlApp.Workbooks.Open("E:\VB程序(千万别动)\数据.xls") '
Set xlsheet = xlBook.Worksheets(1) '
xlsheet.Activate '
xlsheet.Cells(12, 2) = Val(Text2.Text)
xlBook.RunAutoMacros (xlAutoOpen)
Else
MsgBox ("EXCEL已打开")
End If
If Dir("E:\VB程序(千万别动)\excel.bz") = "" Then
xlBook.RunAutoMacros (xlAutoClose)
xlBook.Close (True)
xlApp.Quit
End If
End Sub
主要就是不能自动保存,跪求~~~着急