Stop "File now Available for Editing" box from openning
I have code that imports data from excel, and it works great however the problem is an annoying pop up once the import is done telling the user that the file is available for editing and giving them the option to Read-Write or cancel. How do I get rid of this box when the impport is complete?
I tried displayAlerts and it did not work. Thanks for any help you can provide.
Dim PathStr As String
Dim sPath As String
Dim sheet As String
Dim vDir As Variant
sPath = Forms!frmAgentImport!txtFile 'sPath must end with a back slash,
sheet = Forms!frmAgentImport!txtSheet
vDir = Dir(sPath & "*.*")
PathStr = Forms!frmAgentImport!txtFile
Set xlWB = xlApp.Workbooks.Open(sPath)
DoCmd.RunSQL ("Delete * from tblPreviousYear")
DoCmd.TransferSpreadsheet acImport, 8, "tblPreviousYear", PathStr _
, True, sheet & "!"