I am attempting to merge a couple of cells in excel from access after populating these cells with automation but I keep getting a "Select method of Range class failed" error.
I got the following code from a macro that I created in excel but this macro must need some additional changes to work from within access:
What am I missing?
Thanks
I got the following code from a macro that I created in excel but this macro must need some additional changes to work from within access:
Set objXLSheet = objXLBook.Worksheets("Sheet2")
With objXLSheet
.Range("A1:E1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
End With
What am I missing?
Thanks