EXPORTING Excel that is Reimportable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JHNielson
    New Member
    • Feb 2007
    • 121

    EXPORTING Excel that is Reimportable

    I have a db that exports a file as an Excel. I want users to be able to make changes to that excel and then re-import it.

    I am running into a problem, I want users to see the Logical Names (Captions) so that they can see names they will recognize. But when I try to import the sheet without headings, I get an Field 'F1' doesn't exist error. My research points ot the problem being that there are no headings...

    So i wondered if there is a way to export the captions and the field names.
    Or is there some other option I haven;t thought of?

    Thanks
  • pks00
    Recognized Expert Contributor
    • Oct 2006
    • 280

    #2
    What are you using to import/export excel file

    If in code, are you using DoCmd.TransferS preadsheet?

    if u use that then u can specify whether excel file has headings or not. That should get round your problem

    Comment

    • JHNielson
      New Member
      • Feb 2007
      • 121

      #3
      Originally posted by pks00
      What are you using to import/export excel file

      If in code, are you using DoCmd.TransferS preadsheet?

      if u use that then u can specify whether excel file has headings or not. That should get round your problem
      Yes, I am using DoCmd.TransferS preadsheet. But I get an error. It gives me an error like....No fieldname for F1 found....

      That's the problem I'm having...
      Any ideas around this or how to fix it?

      Comment

      • JHNielson
        New Member
        • Feb 2007
        • 121

        #4
        To be specific i get a "Field F1 Doesn't exist in destination table"

        This is the code I'm using:
        Code:
               DoCmd.TransferSpreadsheet acImport, 5, "DLU-Import", filename, False, "A2:CQ3000"

        Comment

        • JHNielson
          New Member
          • Feb 2007
          • 121

          #5
          Anybody have any ideas?

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            I think you'll have to either just export using the field names and import with the field names or you can import into a placeholder table and use a query to rename the fields before appending them to the main table.

            Comment

            • pks00
              Recognized Expert Contributor
              • Oct 2006
              • 280

              #7
              Can u create columns in your xls file then import it but specify it has columns

              Comment

              Working...