Search code examples
ms-accessxlsm

How to import xlsm file into Access


How does one import a xlsm file into Access?

Naturally, Access gives me the "Please check that the file exists and is in the correct format" error. How ought I to progress?

Working in 2010 for both Excel and Access.


Solution

  • Here's some code, you'll have to change it for your specific filename and such:

    Sub testimport()
        DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "ttblTempAppend1", _
          "M:\Quality\Measurement & Evaluation\Projects\VHP\Dashboard\AAA_Rupture\ttblTempAppend1.xlsm", _
          True, "ttblTempAppend1"
    End Sub