Has anyone experienced this: I have a module that imports data from an Excel spreadsheet using "TransferSpreadsheet". The spreadsheet is one of many protected worksheets in a protected workbook. In order to use "TransferSpreadsheet" the file has to be open in Excel, or Access will throw a "Cannot Decrypt File - Error 3161". (The protection has to remain as the workbook/sheets have many complex formulas which link them.)
The import works just fine. The problem is after I complete the import, and close the Excel file, I get a message that pops up saying:
Here's the code I use:
It is followed by several DoCmd's to update some other tables:
Any ideas what the problem might be? Or is there some vba command that can be added to disconnect/close the connection?
Thanks in advance!
The import works just fine. The problem is after I complete the import, and close the Excel file, I get a message that pops up saying:
'MyFileName.xls' is now available for editing.
Choose Read-Write to open it for editing.
Choose Read-Write to open it for editing.
Here's the code I use:
' Import the current template into the "tblImportStage" table. DoCmd.TransferSpreadsheet acImport, 8, "tblImportStage", "\\MyPath\MyFileName.xls", False, "Template!A3
4507"
It is followed by several DoCmd's to update some other tables:
DoCmd.OpenQuery "qryLoadDetail", acViewNormal, acEdit
DoCmd.Close acQuery, "qryLoadDetail"
DoCmd.Close acQuery, "qryLoadDetail"
Any ideas what the problem might be? Or is there some vba command that can be added to disconnect/close the connection?
Thanks in advance!