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 with Memo

Status
Not open for further replies.

perrymans

IS-IT--Management
Nov 27, 2001
1,340
US
I am using the follwoing to import an Excel spreadsheet:

Code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet1", sFile, False

DoCmd.RunSQL "ALTER TABLE Sheet1 ADD COLUMN ID COUNTER(1,1) CONSTRAINT PrimaryKey PRIMARY KEY;"

The problem is most of the fields need to be Memo type, which isn't what Access defaults to. So my fields are getting cutoff.

What is the better way to import the spreadsheet?

Thanks. Sean.
 
As far as I know, the only way to do this is to create a suitable table and import into that.
 
What about the reverse?

I have Memo fields I want to export to Excel, but they get clipped too.

How can I get all the Memo field info into Excel?

Thanks. Sean.
 
How do I import into an existing table? I get an error if the field already exists.

It works if I copy-paste it into a table (not ideal though). Is that way and option?

Thanks. Sean.
 
If you highlight the word TransferSpreadsheet then select the F1 key it should open the help to the TransferSpreadsheet method.
This is an example of of what we use. Part of the path to the file is a variable and part of the range is a variable.

Docmd.TransferSpreadsheet acImport, 8, "tblEquipImport", "C:\My Documents\" _
& FldName & "\" & ExFileName, True, "Sheet1!S1:W" & intLstRow

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top