I'm writing an Excel Automation app and I'm running to a problem early
on with what should be a basic step.
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
Dim oRng As Excel.Range
oExcel = CreateObject("E xcel.Applicatio n")
oBook = oExcel.Workbook s.Add
oSheet = oBook.Worksheet s(1)
....Populate Sheet...
oRng(Selection, ActiveCell.Spec ialCells(xlLast Cell)).Select()
My application will not compile due to the last line because
Selection, ActiveCell and xlLastCell are not declared. I have added
Excel 10.0 (2002) as a reference. What am I doing wrong?
on with what should be a basic step.
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
Dim oRng As Excel.Range
oExcel = CreateObject("E xcel.Applicatio n")
oBook = oExcel.Workbook s.Add
oSheet = oBook.Worksheet s(1)
....Populate Sheet...
oRng(Selection, ActiveCell.Spec ialCells(xlLast Cell)).Select()
My application will not compile due to the last line because
Selection, ActiveCell and xlLastCell are not declared. I have added
Excel 10.0 (2002) as a reference. What am I doing wrong?
Comment