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!

Importing from Excel 2

Status
Not open for further replies.

jmcg

Technical User
Jun 30, 2000
223
GB
I am looking for a code to import and existing excel file into and existing Access table.
I cannot use TransferSpreadsheet as the field names do not match and I cannot change the excel file to match access (or vice versa).

Tried TransferText but could not create a specification for it as the file is excel not tet.

Searched and found the following that I have been trying to use:
Dim oExcel as New Excel.Application
Dim oSheet as Excel.Worksheet
oExcel.WorkBooks.Open "xxxx.xls"
Set oSheet = oExcel.ActiveWorkbook.Worksheets("SheetName")

It then say to use Cells to proress but offers ot more info.

Can someone help!
I need to continue the above to then select a range of cells
A1:D100 to then populate the table.
 
Why not link the Excel sheet or impoert it and then update the Access table with a query?
 
Why not use TransferSpreadsheet to a temporary table and then play with an append query ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Sometimes the simplest things are the ones you cannot see.
Good suggestions guys, will do that now :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top