A family of Microsoft relational database management systems designed for ease of use.
Okay, you should read this
http://www.btabdevelopment.com/ts/excelinstance
as it will help you but I converted this over (including creating the constants since we are using late binding (which is a good idea).
Dim objXL As Object
Dim objWB As Object
Dim objSheet As Object
Dim c As ObjectConst xlDown As Integer = -4121Const xlFormatFromLeftOrAbove As Integer = 0Const xlLastCell As Integer = 11
Set objXL = CreateObject("Excel.Application")
Set objWB = objXL.Workbooks.Add
Set objSheet = objWB.ActiveSheet
With objXLobjSheet.Range("A2").Select
**.**ActiveCell.Rows("1:1").EntireRow.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
**.ActiveCell.Offset(1, 0).Copy Destination:=.**ActiveCell
iPrevious = **.**ActiveCell.Value
For Each c In **objSheet.Range(.**ActiveCell.Offset(1, 0).Address, Chr(64 + **.**ActiveCell.Column) & **.**ActiveCell.SpecialCells(xlLastCell).Row)
If c.Value <> "" Then
If c.Value = iPrevious Then
c.Value = ""
Else
c.Rows("1:1").EntireRow.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
c.Offset(-1, 0).Value = c.Value
iPrevious = c.Value
End If
End If
Next c
End With