change excel spreadsheet before importing

C

Clemens

Hi,

I don't know if it is possible but i hope it will.

I perform each week an import from an excel sheet. One of the fields has a
fieldname with a dot (like main.window). When importing excelsheet into
access it fails because of this fieldname. I can change the fieldname in
excel before importing, but I will cost me extra time.
Is there a possibility from access using a code to change the fieldname of
an import sheet before importing?

Sorry for poor english, so if more explaination is needed just ask.

I hope if you can help me out
 
C

Clemens

I was thinking a bit further....

The import from excel to access is done with the selection 'First Row
Contains Column Heading' on.

I use the following code:

DoCmd.RunSQL "DELETE * FROM SCexport2"
DoCmd.TransferSpreadsheet acImport, , "SCexport2",
..SelectedItems.Item(1), True

So if it is possible to change the code to import the spreadsheet without
the first row, I do not need to change fieldnames.
 

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