HI experts,
need a vb macro which open workbook and save in utf-8 encoding format
i have script which run macro on time.
so here required only vb macro that open file and save as in utf-8 format
i find below macro which solve the purpose but it requires file name open popup i want to set the path of file name in macro itself
below is code
Sub CSVtoUTF()
Dim file As variant
file = Application.GetOpenFilename("CSV Files (*.csv), *.csv")
If file = False Then Exit Sub
With CreateObject("ADODB.Stream")
.Charset = "UTF-8"
.Open
.LoadFromFile file
.SaveToFile file & "_with_UTF-8_BOM.csv", 2
.Close
End With
End Sub
it requires a file and then work ,i want to set file path also in macro so it fetches file from set location automatically
Bookmarks