Importing from Excel

G

Guest

I have an Excel Workbook that has multiply sheets. How would I import data
from each of the sheets in the workbook. I set it up using the
transferspreadsheet method, but can not figure out how to transfer each of
the worksheets.
 
G

Guest

The last argument in the TransferSpreadsheet is the range. Put the name of
the worksheet in that argument.
 
G

Guest

Ok, How do you format the worksheet name. WHen I just put the worksheet name
in parantheses is give me an error saying it can't be found

stTableName = WalmartStores
stDocName = "G:\Accounting\AR\AR Database\walmart stores.xls"
DoCmd.TransferSpreadsheet acImport, , "WalmartStores", stDocName, True,
"Wal-Mart Stores"
 
G

Guest

Your syntax is correct. Is one of the sheets named Wal-mart Stores? If you
got Error 3011, then either you misspelled the name, or it does not exist
within that workbook. If you got another error, please post back and be
specific with the error number and text. Also, what versions of Access and
Excel are you on?
 

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