Run-time error '31519'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JFKJr
    New Member
    • Jul 2008
    • 126

    #1

    Run-time error '31519'

    HI!, I am trying to import an excel file to an Access table using the following code, but I am getting "Run-time error '31519':You cannot import this file" error.

    Code:
    Function Import_ExcelFile()
    DoCmd.TransferText acImportDelim, , "ImportedData", "C:\ExportFile\Test_file.xls", True
    End Function
    I am using Access 2003 database.

    Please kindly help me what to do. Any help would be greatly appreciated. Thanks in Advance.
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    I think you are looking for the TransferSpreads heet Method and not TransferText.

    Comment

    • JFKJr
      New Member
      • Jul 2008
      • 126

      #3
      Originally posted by ADezii
      I think you are looking for the TransferSpreads heet Method and not TransferText.
      Yes, I got it thanks anyway for the reply.

      I have successfully imported an excel file into an Access table, but now I am facing another problem i.e., the table has an empty field (field with no data). I am having trouble to delete this empty field using Access VBA code. Do you have any idea about deleting an empty field in an Access table?

      Any help would be greatly appreciated. Thanks.

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by JFKJr
        Yes, I got it thanks anyway for the reply.

        I have successfully imported an excel file into an Access table, but now I am facing another problem i.e., the table has an empty field (field with no data). I am having trouble to delete this empty field using Access VBA code. Do you have any idea about deleting an empty field in an Access table?

        Any help would be greatly appreciated. Thanks.
        Oddly enough, I just replied to a similar Thread, have a look. BTW, why not simply Delete the Field manually?



        P.S. - Kindly keep the Threads separate from each other.

        Comment

        • JFKJr
          New Member
          • Jul 2008
          • 126

          #5
          Originally posted by ADezii
          Oddly enough, I just replied to a similar Thread, have a look. BTW, why not simply Delete the Field manually?



          P.S. - Kindly keep the Threads separate from each other.
          Sorry for the two posts, I actually posted the same question twice in my two separate threads. I got your reply from the other post. Thanks!

          Comment

          Working...