Stop "File now Available for Editing" box from openning (1 Viewer)

aamirault

New member
Local time
Today, 01:24
Joined
Aug 24, 2005
Messages
5
Hi,

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.

Code:
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.SetWarnings (WarningsOff)
DoCmd.RunSQL ("Delete * from tblPreviousYear")


DoCmd.TransferSpreadsheet acImport, 8, "tblPreviousYear", PathStr _
, True, sheet & "!"



Call ExcelQuit
 

aamirault

New member
Local time
Today, 01:24
Joined
Aug 24, 2005
Messages
5
Workaround found

Hi All,

Thought I would post the Microsoft workaround for this isssue.

All you need to do is share the workbook and allow others to update the workbook.

Since this removes the exclusive lock Excel will not prompt you.

Hope this helps others.
 

Users who are viewing this thread

Top Bottom