0

Im converting an excel sheet automatically into csv with vb.net, I need the column separator to be ; On my system (Windows 10) this works by setting the Local parameter to ";" in the SaveAs - method. However it doesnt work on a server with Windows Server 2019 version

    Friend Sub Export(PathOfTemplate As String, PathOfCopy As String)
        Try
            _Books = _excel.Workbooks
            _Book = _Books.Open(PathOfTemplate)
            _Sheets = _Book.Worksheets
            _Sheet = DirectCast(_Sheets(1), Excel.Worksheet)
            If File.Exists(PathOfCopy) Then File.Delete(PathOfCopy)
            _Sheet.SaveAs(PathOfCopy, Excel.XlFileFormat.xlCSVWindows, Type.Missing, Type.Missing, _
                          Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, ";")
        Finally
            _Book.Close()
            _Books.Close()
        End Try
    End Sub

Is there another way or what should I look for?

  • According to [Considerations for server-side Automation of Office](https://support.microsoft.com/en-us/topic/considerations-for-server-side-automation-of-office-48bcfe93-8a89-47f1-0bce-017433ad79e2): _Microsoft does not recommend or support server-side Automation of Office_. – Tu deschizi eu inchid Jan 17 '23 at 18:46
  • This seems to be a duplicate of https://stackoverflow.com/questions/5034717/save-an-excel-file-to-a-csv-file-in-c-sharp-code – Tu deschizi eu inchid Jan 17 '23 at 18:57

0 Answers0