Export Access to Excel template

G

Guest

Hello, I am trying to export the access data into a excel template I already
design, How can I write the code to automated fill into the right cell in
excel when I export the data from access.

Thank you!
 
J

Jesper

Hello, I am trying to export the access data into a excel template I
already
design, How can I write the code to automated fill into the right cell in
excel when I export the data from access.

This function opens Excel and inserts som text:

Function fExcel()
Dim objExcelApp As Object 'late binding
Dim objExcelDoc As Object 'late binding
Set objExcelApp = CreateObject("excel.application") 'late
binding
Set objExcelDoc = objExcelApp.Workbooks.Add
objExcelApp.Visible = True
With objExcelDoc.Sheets(1)
.Range("A1").Value = 1
.Range("A2").Value = 2
.Range("A3").Value = "Hello"
End With
Set objExcelDoc = Nothing
Set objExcelApp = Nothing

End function



/ Jesper Fjølner
 

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