How would I use F1, F2, etc. if I'm saving over the linked file? Unless you mean exactly what CJ suggested?
Not sure what "just refer to the field positions" means either. But I appreciate all the replies and your time. Thank you!
What does "use Trim as you brought it in" mean? The field name would still vary from one linked file to another (according to the file saved over it).
Edit: I don't think you can use an expression on an unknown field name, if that's what you're saying.
Thank you CJ! That sounds more elegant than my workaround. Maybe a dumb question but what if I don't know how many rows of data there are to import? It varies. Can I still specify the range?
Thank you but that wouldn't work because the field name in question could still have the leading zero. (Edit: I mean trailing space, not leading zero. Scatterbrained!)
I could not find any way to trim the trailing spaces upon import, but I worked around the issue by adding this code before the DoCmd.TransferSpreadsheet line. (The field name in question is in cell Z1 of the source file.)
Dim xlapp As Object
Dim xlBook As Object
Dim xlSheet As...
Hello and thank you in advance for any help you can give me.
I was recently converted to Office 365, and as a result, DoCmd.TransferSpreadsheet no longer trims trailing spaces from field names.
I have a database that imports a single file from a client. (Please see form code below.) The...