Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Importing Multiple Worksheets into access

Posted on 2010-11-17
3
Medium Priority
?
517 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

715 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