谢谢指点!已实验成功!请教一下老师:用同样的方法将代码中的“Word" 换成“Excel”后就打不开Excel程序呢?代码在“Excel.Visible = True”报错,请指导如何修改代码,打开Excel程序!谢谢!作者: 123shusheng 时间: 2014-10-2 15:16
Private Sub Command81_Click()
Dim wordApp As New Word.Application
Dim wordArange As Word.Range
Dim wordSelection As Word.Selection
Set wordApp = CreateObject("Word.Application")
wordApp.Visible = True
wordApp.Documents.Open (CurrentProject.Path & "\1.doc")
Set wordSelection = wordApp.Selection
'指定文件编辑位置
Set wordArange = wordApp.ActiveDocument.Range(0, 1)
wordArange.Select
End Sub