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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import Excel Sheet By Name 1

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,212
US
Ok this took me way too long to figure out.... The short version is if you concatenate a dollar sign on the end of a sheet name you can use that as a range in transferspreadsheet...

Code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, strTable, strFilePath, blHasHeaderRow, strSheet & "$"

Thanks to a post Remou made a while back I was able to grasp the issue.

Keywords to find this later:
Excel Sheet as Range
How do I import an Excel sheet into Access?
Reference Excel Sheet as Range
 
Already discuted here:
27 Aug 08 0:19 : thread705-1496673
13 May 08 13:25 : thread707-1472959

Another (probably safer) way:
15 Feb 05 14:39 : thread705-1006240

To get the names of all the sheets of a workbook without automating Excel but using ADO;
24 Jan 07 1:23 : thread701-1325960
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top