Create border and merge cell in Excel file

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
 
R

RoyVidar

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 ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top