Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim x As Integer
Dim i As Integer
Private Sub cmd1_Click()
On Error Resume Next
Set xlApp = GetObject("Excel.Application") '创建Excel对象
Set xlBook = xlApp.Workbooks.Open("F:\123.xlsx") '打开你的EXCEL文件
Set xlSheet = xlBook.Worksheets("Sheet1") '第一个表格
xlApp.Visible = False '设置Excel True可见,False不可见
xlSheet.Activate
xlSheet.Cells(3, 4) = "SSSS"
xlBook.Save
xlBook.Close
xlApp.Quit '结束Excel对象
Set xlApp = Noting '释放xlApp对象
End Sub
这段代码哪里出现了问题,为啥我的123.xlsx什么也没发生改变?
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim x As Integer
Dim i As Integer
Private Sub cmd1_Click()
On Error Resume Next
Set xlApp = GetObject("Excel.Application") '创建Excel对象
Set xlBook = xlApp.Workbooks.Open("F:\123.xlsx") '打开你的EXCEL文件
Set xlSheet = xlBook.Worksheets("Sheet1") '第一个表格
xlApp.Visible = False '设置Excel True可见,False不可见
xlSheet.Activate
xlSheet.Cells(3, 4) = "SSSS"
xlBook.Save
xlBook.Close
xlApp.Quit '结束Excel对象
Set xlApp = Noting '释放xlApp对象
End Sub
这段代码哪里出现了问题,为啥我的123.xlsx什么也没发生改变?