miketastic
New Member
- Joined
- Apr 8, 2015
- Messages
- 14
Hello,
I was using the following code successfully to disable the popup box asking if the user would like to overwrite the file of the same name. However, when I changed the Path to a location on a network drive (not only does the macro run painfully slow), the application.enableevents stopped working. It doesn't disable anything and I changed nothing about the code other than the path from "P:" to "\\10.1.555.555\stuff"
I'm still pretty new at this stuff, I'm sure it's something I'm doing wrong. Thanks for you help!
I was using the following code successfully to disable the popup box asking if the user would like to overwrite the file of the same name. However, when I changed the Path to a location on a network drive (not only does the macro run painfully slow), the application.enableevents stopped working. It doesn't disable anything and I changed nothing about the code other than the path from "P:" to "\\10.1.555.555\stuff"
I'm still pretty new at this stuff, I'm sure it's something I'm doing wrong. Thanks for you help!

Code:
Dim MyPath As String
Dim MyFileName As String
MyPath = "P:"
MyFileName = "CSVUPLOAD"
If Not Right(MyPath, 1) = "\" Then MyPath = MyPath & "\"
If Not Right(MyFileName, 4) = ".csv" Then MyFileName = MyFileName & ".csv"
Sheets("CSV UPLOAD").Copy
Application.EnableEvents = FalseWith ActiveWorkbook
.SaveAs Filename:=MyPath & MyFileName, FileFormat:=xlCSV, CreateBackup:=False
.Close False
End With
Application.EnableEvents = True