I am using Access 2010
I need to format cells inside the Excel spreadsheet
Here is my code
the code "With xlWSh.Selection" returns a run-time error 438 - Object does not support this property or method
Where am I going wrong?
When coding, when entering a "bang" ("."), Access normally returns the next piece of code.
The code above does not!
How to I correct this?
I do have a reference to Microsoft Excel 14.0 Object library
Many thanks in advance
I need to format cells inside the Excel spreadsheet
Here is my code
Code:
Dim ApXL As Object
Dim xlWBk As Object
Dim xlWSh As Object
Dim intColumn As Long
Set ApXL = CreateObject("Excel.Application")
ApXL.Application.ScreenUpdating = True
ApXL.Visible = True
Set xlWBk = ApXL.Workbooks.Add
intColumn = 3
xlWSh.Range(Chr(64 + intColumn) & "3:" & Chr(64 + intColumn + 1) & "3").Select
With xlWSh.Selection
.MergeCells = True
.HorizontalAlignment = xlCenter
End With
xlWBk.Save
xlWBk.Close False
ApXL.Quit
Where am I going wrong?
When coding, when entering a "bang" ("."), Access normally returns the next piece of code.
The code above does not!
How to I correct this?
I do have a reference to Microsoft Excel 14.0 Object library
Many thanks in advance