Excel To MDB

V

VBA

Hi

I Export Empty MDB table to Excel with this command

DoCmd.OutputTo



Now I get this XLS file with new rows that I need append to my MDB Table

What is the ways to do it?



What I do now…

I check MDB tables Fields for their type generate INSERT SQL statement

With data from XLS

And run SQL





Maybe some body know other ways?
 
A

antoni gervais

Why not try something like this :

Set MyXL = CreateObject("excel.application")
Set MyFile = MonXL.workbooks.Open(<file_name>)

' Here you can use VBA statements applicable to your case

For i = 1 To MyFile.sheets.Count
MyFile.sheets(i).Name = Right(MyFile.sheets
(i).Name, Len(MyFile.sheets(i).Name) - 1)
Next i

MyXL.Visible = True
MyXL.UserControl = True
MyFile.Close SaveChanges:=True
MyXL.Quit
Set MyFile = Nothing
Set MyXL = Nothing
 

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