Solved

Importing Multiple Worksheets into access

Posted on 2010-11-17
3
506 Views
Last Modified: 2012-11-16
I am trying to Import some data from an excel spreadsheet using the TransferSpreadsheet method and I cannot seem to get the Worksheet part correct with the range.

I am using:  

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "ExcelTally1", fileName, False, "Excel_Export1"

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "ExcelTally2", fileName, False, "Excel_Export2"

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "ExcelTally3", fileName, False, "Excel_Export3"

But it fails each time.
0
Comment
Question by:mjelec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 34158639
is "Excel_Export1" the name of the worksheet?, add a Bang (!)

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "ExcelTally1", fileName, False, "Excel_Export1!"
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34158645
add a Bang (!) sign to import the whole sheet.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34158701
to import a certain range  A1:K100

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "ExcelTally1", fileName, False, "Excel_Export1!A1:K100"
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question