Create border and merge cell in Excel file

  • Thread starter Thread starter Chlaris
  • Start date Start date
C

Chlaris

Dear all,

I want to create border and merge cell in Excel file, how to write the code
in Access ?
Please complete my below code. Thanks.

Dim objXL As Object
Dim objActiveWkb As Object

Set objXL = GetObject(, "Excel.Application")
Set objActiveWkb = objXL.Application.activeworkbook

With objActiveWkb
.Worksheets(1).cells(1, 1) = "Hello World"
'want to make border in cell (1,1)

'want to merge cell from A1:F1

End With
Set objActiveWkb = Nothing: Set objXL = Nothing
 
Chlaris said:
Dear all,

I want to create border and merge cell in Excel file, how to write the code
in Access ?
Please complete my below code. Thanks.

Dim objXL As Object
Dim objActiveWkb As Object

Set objXL = GetObject(, "Excel.Application")
Set objActiveWkb = objXL.Application.activeworkbook

With objActiveWkb
.Worksheets(1).cells(1, 1) = "Hello World"
'want to make border in cell (1,1)

'want to merge cell from A1:F1

End With
Set objActiveWkb = Nothing: Set objXL = Nothing

Excel is different from Access in many ways, one of them is the ability
to register macros.

When I don't know the code to do something in Excel (which happens quite
often), I'll open Excel, hit the macro recorder, do my stuff, then
investigate the code.

When transferring to Access, I'll ensure any Excel object is "anchored"
in it's relevant Excel object.

In stead of giving you the code, this should be the means to get it.
Post back if you get problems ;-)
 
Back
Top