Article ID: 178510
Article Last Modified on 5/14/2007
Error message 1
Error message 2
Error message 1
Error message 2
Option Explicit
Private Sub Command1_Click()
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets("Sheet1")
xlSheet.Range(Cells(1, 1), Cells(10, 2)).Value = "Hello"
xlBook.Saved = True
Set xlSheet = Nothing
Set xlBook = Nothing
xlApp.Quit
Set xlApp = Nothing
End Sub
xlSheet.Range(Cells(1,1),Cells(10,2)).Value = "Hello"Change the line of code to resemble the following line of code.
xlSheet.Range(xlSheet.Cells(1,1),xlSheet.Cells(10,2)).Value = "Hello"
167223 Microsoft Office 97 Automation Help file available
189618 You may receive the "Run-time error '-2147023174' (800706ba)" error message or the "Run-time error '462'" when you run Visual Basic code that uses Automation to control Word
Additional query words: activex automation OLE kbinterop kbAutomation kbVBp kbVBp400 kbVBp500 kbVBp600 XL2003 XL2007
Keywords: kbautomation kbtshoot kbprb KB178510