prevent the permission box from appearing when I over write a file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My macro step to transfer a spreadsheet to excel triggers a box asking
permission to over write a file. How do I eliminate that box from appearing?
Thanks for your help.
 
I couldn't figure it out, either, so I handled that recently by writing a
batch file that deleted the target spreadsheet if it exists before exporting
the Excel sheet.

Contents of RemoveFile.bat:
del "<Drive>:\Path\Filename.xls"

Access code to call the batch file:

Private CopyOut As Variant
CopyOut = Shell("<Drive>:\Path\RemoveFile.bat", 0)
<Add your code to export spreadsheet on this line>
End sub

It is probably a workaround, but it works for me. You might also build in a
delay after the CopyOut to ensure that the batch file has time to complete
the deletion before you export the .xls.
 
Back
Top