access - importing specific data from excel

hello,

i know this command to import data from excel to access : DoCmd.TransferSpreadsheet acImport, 3, _
"Employees","C:\Lotus\Newemps.wk3", True, "A1:G12"

i know how to use this command, the only problem is i have a variety of excel files differ from each other in the upper-left and lower-right edges of the tabular data.

is there any way i can get into the workbook and check this information

thanks

refael




Answer this question

access - importing specific data from excel

  • Roman Koreshkov

    Hi Refael

    Not sure I understand your question, to see the data before importing is as simple as opening the files with Excel.

    If there is just a formating issue you could import into a temporary table, then use access functions, querys etc to reformat and update your final table.


  • Rich Baker

    thatnks for your reply,

    the thing is i am writing a code in vba and everything has to go through the code.

    refael



  • GrahamCownie

    yes this helps.

    thanks



  • Basel2

    I posted a question recently which may be related. I asked how to open Excel from Access to work with Excel data.

    If you use Excel.Application (see help text), you can open excel then open and work with workbooks. This will allow you to explore the data you want to validate with VBA code, and modify the cells before importing.


  • access - importing specific data from excel