DoCmd.TransferSpreadsheet help

  • Thread starter Thread starter Tom & Roxanne Hanson
  • Start date Start date
T

Tom & Roxanne Hanson

I have an excel spreadsheet that uses the first row as titles (field names),
I import with True and it normally works.

Several of my users have created spreadsheets with spaces in front of the
field name, now acImport does not work. Is there a way to Trim the field
names before running the Import? I can import with False but then have to
extract each field from record 1, trim it and name the field. Is there a
better way?

Thanks.

Tom
 
Tom & Roxanne Hanson said:
I have an excel spreadsheet that uses the first row as titles (field names),
I import with True and it normally works.

Several of my users have created spreadsheets with spaces in front of the
field name, now acImport does not work. Is there a way to Trim the field
names before running the Import? I can import with False but then have to
extract each field from record 1, trim it and name the field. Is there a
better way?

Thanks.

Tom

"Slap your users' knuckles when they do that"? Sorry, it's late and I
couldn't resist! :-)

I don't know of any way to "trim" header strings during the
TransferSpreadsheet process. You could use Automation to open the EXCEL file
and trim the headers, save and close the file, and then import it. But, if
you've already got a method worked out using the extraction process, I'd
probably stick with that.
 
Back
Top