I have been looking at a lot of threads about similar issues but none address my issue.
I have a macro that works just find on my local machine. but it need to run from a network drive as several different people may need to access it.
A brief description of the macro.
The macro looks in an directory called unprocessed for any file named "*.csv"
if the files are found it opens the file in excel and then copies data from that workbook to my workbook.
after this the .csv file is closed (unchanged) and then it is moved to the processed directory.
Sub files()
Dim directory As String, filename As String, sheet As Worksheet, i As Integer, j As Integer
Dim filetype As String
Application.ScreenUpdating = False
directory = "\\my network path\unprocessed\*.cvs"
filename = Dir(directory)
If Len(filename) = 0 Then
MsgBox "No New files to process."
End If
Do While filename <> "" -if file exists
-...
-...
-... code to process files should work if file name holds the correct filename.
-...
-...
filename = Dir() -get next file
Loop
ThisWorkbook.Save -save the new workbook.
End Sub
this code does not work if I use a mounted drive either
directory = "Z:\unprocessed\*.cvs"
I have been banging my head on this one for a week now.
Thanks in advance.
Bookmarks