Importing from Excel using VB with questions

G

Guest

I am currently using the following code to import data into a table from
excel but am having problems:

Dim appAcc As Access.Application

Set appAcc = New Access.Application

appAcc.Visible = True

appAcc.OpenCurrentDatabase "C:\Windows Inventory.mdb"

appAcc.DoCmd.TransferSpreadsheet acImport, , "Windows Machining",
"C:\test.xls"

appAcc.Quit

The code runs fine up to the "TransferSpreadsheet" line where it hangs up. I
am unsure as to why it is not working, any thoughts?
 
G

Guest

I actually did some more searching and found the answer to my question. The
reason it would not import is because the table i was trying to import to had
more fields than the data i was trying to import.
 

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