By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,696 Members | 1,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,696 IT Pros & Developers. It's quick & easy.

Importing into Access table form Excel

P: 1
HI Folks,
I need some help
I'm trying to develop a automated way to import from a excel spsh excluding the 1st 2 rows & two out of 41 columns.
I got the 1st part with range see below

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "[mytable]", filePath, , "A3:AO3000", True or False ?
I know I can edit the spdsh before this runs but I'm trying to avoid that & also not bother the "client"
I know the colums to skip #8 & # 31 as well.

Thanks in advance
Chris
Jul 13 '07 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,692
HI Folks,
I need some help
I'm trying to develop a automated way to import from a excel spsh excluding the 1st 2 rows & two out of 41 columns.
I got the 1st part with range see below

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "[mytable]", filePath, , "A3:AO3000", True or False ?
I know I can edit the spdsh before this runs but I'm trying to avoid that & also not bother the "client"
I know the colums to skip #8 & # 31 as well.

Thanks in advance
Chris
You may be more successful by:
  1. Importing the entire Worksheet.
  2. Run a DELETE Query that DELETES the 1st 2 Rows.
  3. DELETE your 2 Columns (Fields) by using the DELETE Method of the TableDef Object as in:
    Expand|Select|Wrap|Line Numbers
    1. CurrentDb.TableDefs("<your Table>").Fields.Delete "<your Field>"
Jul 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.