How to Get data from Excel to Access By VBA

P

Paul

I have an excel table and access database. Everytime I get errors when I try
to import the excel table into the Access. So I decided to use VBA to do it,
but I don't know how to write the codes in the Access file to control the
excel data. For example, how can I let my Access VBA code read data from the
other excel file?
 
G

Gerald Maier

Option Compare Database
Option Explicit

Global xlsAPP As Object

Function gma_open_xls(xlsdatei As String)
Dim i As Long
Set xlsAPP = CreateObject("Excel.Application")
xlsAPP.Application.workbooks.Open xlsdatei, 3
xlsAPP.Application.Visible = True
End Function

-> xlsAPP.Application.sheets("tabelle").Select
-> xlsAPP.cells(1, 1).Value 'usw

lg..gma
 

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