Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Docmd.TransferSpeadsheet question.

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi,

The spreadsheet I want to import has 2 sheets in it.

Using this line, I only get first sheet imported:
DoCmd.TransferSpreadsheet acImport, , "Eroom", path, True

How to import two sheets into two different tables?

Thanks.
 
Well, I have figured that to import multiple sheets I would use the names of the sheets:

DoCmd.TransferSpreadsheet acImport, , "Eroom1", path, True, "Individual Billing!"
DoCmd.TransferSpreadsheet acImport, , "Eroom2", path, True, "Group Billing!"

But that is when I ran into another problem. Since the names of sheets have a space 'Group Billing', I receive an error, saying that the object cannot be found. Once I change the name to 'Group_Billing', then it runs smoothly.

Is there a solution to import a sheet that has a space in the name, because I receive my spreadsheet from someone else, who would change the names of sheets.

Please advise me on this.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top