Private Sub Command1_Click() Dim Ex As Object Dim ExBook As Object Dim ExSheet As Object Set Ex = CreateObject("Excel.Application") Set ExBook = Ex.workbooks.open("C:\Win98\Desktop\11T.xls") Set ExSheet = ExBook.worksheets("Sheet1") ExSheet.Cells(1, 1).Value = "1" 'SendKeys "{ENTER}" '这样效果很不好啊 'Ex.Visible = False '还是出现哪个对话框啊!还是谢谢Tsou() Ex.DisplayAlerts = False '解决了 谢谢 还俗和尚.COM ExBook.Close Ex.quit Set Ex = Nothing Set ExBook = Nothing Set ExSheet = Nothing End Sub
Dim Ex As Object
Dim ExBook As Object
Dim ExSheet As Object
Set Ex = CreateObject("Excel.Application")
Set ExBook = Ex.workbooks.open("C:\Win98\Desktop\11T.xls")
Set ExSheet = ExBook.worksheets("Sheet1")
ExSheet.Cells(1, 1).Value = "1"
'SendKeys "{ENTER}" '这样效果很不好啊
'Ex.Visible = False '还是出现哪个对话框啊!还是谢谢Tsou()
Ex.DisplayAlerts = False '解决了 谢谢 还俗和尚.COM
ExBook.Close
Ex.quit
Set Ex = Nothing
Set ExBook = Nothing
Set ExSheet = Nothing
End Sub