Problem with importing excel file to access

  • Thread starter Thread starter Lis
  • Start date Start date
L

Lis

Hello,
I am using transferspreadsheet action to import an
excel file to Access. The code which I am using is as
follows.

DoCmd.TransferSpreadsheet
acImport,acSpreadsheetTypeExcel9, c, F, Yes

This code importing the file to Access. But the problem is
I am not getting the fieldnames.Instead of fieldnames like
Item, description, Price etc.... I am getting F1, F2, F3
etc...

When I create macro, this works fine. But I have to use
the code to import the file.
any help, It is really appreciated.
 
Change Yes to True (the argument that tells ACCESS to use field names from
first row).
 

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

Back
Top