I am trying to convert excel to csv format & am successful in this part.
I am facing a problem when i give the path of my server to save the file
but when i store it on my local machine it works fine.
Plz help me with this how can i pass the server location
Code:
--------------------------
Public Sub SaveWorksheetsAsCsv()
Dim WS As Excel.Worksheet
Dim SaveToDirectory As String
SaveToDirectory = "C:\"
For Each WS In ThisWorkbook.Worksheets
WS.SaveAs SaveToDirectory & WS.Name, xlCSV
Next
End Sub
I am facing a problem when i give the path of my server to save the file
but when i store it on my local machine it works fine.
Plz help me with this how can i pass the server location
Code:
--------------------------
Public Sub SaveWorksheetsAsCsv()
Dim WS As Excel.Worksheet
Dim SaveToDirectory As String
SaveToDirectory = "C:\"
For Each WS In ThisWorkbook.Worksheets
WS.SaveAs SaveToDirectory & WS.Name, xlCSV
Next
End Sub