用vb做了个可视化的窗口,怎么将在窗口中输入的内容显示在制定的excel单元格中
展开全部
Private Sub Command1_Click()
Set objexcel = CreateObject("Excel.application")
objexcel.DisplayAlerts = False
Set objworkBook = objexcel.Workbooks.Open("d:\book1.xls"神备樱)
objexcel.activecell.Value = text1 '保存到当前单元格游丛
'objworkBook.activesheet.cells(r, c).Value = text1 '保存到指定单元格用这句,滚闹需要指定r和c即第几行和第几列
objworkBook.Save
objworkBook.Close
objexcel.quit
Set objexcel = Nothing
End Sub
Set objexcel = CreateObject("Excel.application")
objexcel.DisplayAlerts = False
Set objworkBook = objexcel.Workbooks.Open("d:\book1.xls"神备樱)
objexcel.activecell.Value = text1 '保存到当前单元格游丛
'objworkBook.activesheet.cells(r, c).Value = text1 '保存到指定单元格用这句,滚闹需要指定r和c即第几行和第几列
objworkBook.Save
objworkBook.Close
objexcel.quit
Set objexcel = Nothing
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询