Importing Excel into Access 2007

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DAF LAD
    New Member
    • Oct 2006
    • 8

    Importing Excel into Access 2007

    Hi all,

    I have been running a database in Access 2003 for may years now.

    One of the update functions that I do imports an excel spreadsheet into a table in my database. I have this automatically working from a command button through vb code.

    Recently I have upgraded my office suite to the 2007 edition. Now when I try to run this command from this button I get an error code saying that something is missing (in the access file nothing I have written). I have created these as imports from external data and saved them so that I can click on the "saved imports" icon for now but I was wondering if there is a way of running these saved imports from a command button (through vb code or embedded macros) as my original code does not seem to work

    Thanks in advance

    Diego
  • cori25
    New Member
    • Oct 2007
    • 83

    #2
    Can I see the code that you are using, please.

    Comment

    • DAF LAD
      New Member
      • Oct 2006
      • 8

      #3
      the code that I have been using is as follows:

      Private Sub Import_PBs_Clic k()
      DoCmd.TransferS preadsheet acImport, 0, _
      "z new pbs", "....\new pbscrs\newpbs.x ls", True
      End Sub

      where "z new pbs" is the table in access

      Thanks again

      Diego

      Comment

      Working...