none
convert excel to csv RRS feed

  • Question

  • How do you convert excel to csv without excel, library, etc installed?
    • Moved by Sabah ShariqMVP Wednesday, January 4, 2017 10:47 AM Related to Microsoft Excel
    Wednesday, January 4, 2017 12:23 AM

All replies

  • Hi AliceW27,

    Wish link below can help you.

    http://exceldatareader.codeplex.com/

    Thanks

    Wednesday, January 4, 2017 1:06 AM
  • Hi,

    I often use this free .NET Excel library to convert Excel to other file formats without installing MS Excel. It's easy to use and works great except for the limitations of free version, you can get it from NuGet.



    • Edited by Jamesbn Wednesday, January 4, 2017 2:13 AM
    Wednesday, January 4, 2017 2:06 AM
  • Nothing can be installed ie libraries.
    Wednesday, January 4, 2017 2:53 AM
  • Nothing can be installed ie libraries.

    Then start reading and start programming. You're on your own if you can't
    use any existing solutions.

    [MS-XLS]: Excel Binary File Format (.xls) Structure
    https://msdn.microsoft.com/en-us/library/office/cc313154(v=office.12).aspx

    OpenOffice.org's Documentation of the
    Microsoft Excel File Format
    http://www.openoffice.org/sc/excelfileformat.pdf

    - Wayne

    Wednesday, January 4, 2017 3:14 AM
  • How do you convert excel to csv without excel, library, etc installed?

    If you can use the libraries already installed with Visual Studio,
    then there should be solutions on the Web. e.g. -

    Convert Excel file (XLS) to CSV
    http://snipplr.com/view/71092/convert-excel-file-xls-to-csv/

    How to Convert XLS File into CSV File in C#
    http://www.c-sharpcorner.com/uploadfile/yuanwang200409/how-to-convert-xls-file-into-csv-file-in-C-Sharp/

    Is there any simple way to convert .xls file to .csv file? (Excel)
    http://stackoverflow.com/questions/2536181/is-there-any-simple-way-to-convert-xls-file-to-csv-file-excel

    - Wayne

    Wednesday, January 4, 2017 3:39 AM
  • Hi AliceW,

    One is to Save As -> .csv extension format.


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Wednesday, January 4, 2017 10:47 AM
  • One is to Save As -> .csv extension format.

    "Save As" from *where*? Didn't the OP say

    "without excel, library, etc installed?"

    Note the comma after "excel". That means NOT using Excel.

    I suspect that the reason the OP posted the thread in the Visual C#
    forum was because the goal is to convert using a C# program - without
    using any libraries. Not an easy task.

    - Wayne

    Wednesday, January 4, 2017 1:03 PM
  • Sorry Wayne. I misread the comma.

    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Wednesday, January 4, 2017 3:26 PM
  • Hi,

    Normally, if we want to manipulate Office files without installation, we could use Open XML library (need to install Open XML SDK Tool or get it from NutGet)

    But you mentioned nothing can be installed. I suggest you visit the links Wayne shared using built-in libraries in VS.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, January 5, 2017 2:48 AM
    Moderator
  • Is this a C# question of a VBA question?  If you want to convert all Excel files in a folder to CSV files, run the following script.

    Sub Convert_Excel_To_PDF()
        Dim MyPath As String, FilesInPath As String
        Dim MyFiles() As String, Fnum As Long
        Dim mybook As Workbook
        Dim CalcMode As Long
        Dim sh As Worksheet
        Dim ErrorYes As Boolean
        Dim LPosition As Integer
     
        'Fill in the path\folder where the Excel files are
        MyPath = "C:\Users\Ryan\Desktop\Excel_Files\"
     
        FilesInPath = Dir(MyPath & "*.xlsx*")
        If FilesInPath = "" Then
            MsgBox "No files found"
            Exit Sub
        End If
     
        Fnum = 0
        Do While FilesInPath <> ""
            Fnum = Fnum + 1
            ReDim Preserve MyFiles(1 To Fnum)
            MyFiles(Fnum) = FilesInPath
            FilesInPath = Dir()
        Loop
     
        With Application
            CalcMode = .Calculation
            .Calculation = xlCalculationManual
            .ScreenUpdating = False
            .EnableEvents = False
        End With
     
        If Fnum > 0 Then
            For Fnum = LBound(MyFiles) To UBound(MyFiles)
                Set mybook = Nothing
                On Error Resume Next
                Set mybook = Workbooks.Open(MyPath & MyFiles(Fnum))
                On Error GoTo 0
     
                If Not mybook Is Nothing Then
     
                        
                        LPosition = InStr(1, mybook.Name, ".") - 1
                        mybookname = Left(mybook.Name, LPosition)
                        mybook.Activate
                        'All XLSX Files get saved in the directory below:
                        ActiveWorkbook.SaveAs Filename:="C:\Users\Ryan\Desktop\Excel_Files\" & mybookname & ".csv" _
                            , FileFormat:=xlCSVMSDOS, _
                            CreateBackup:=False
                            
                End If
                
                mybook.Close SaveChanges:=False
     
            Next Fnum
        End If
     
        If ErrorYes = True Then
            MsgBox "There are problems in one or more files, possible problem:" _
                 & vbNewLine & "protected workbook/sheet or a sheet/range that not exist"
        End If
     
        With Application
            .ScreenUpdating = True
            .EnableEvents = True
            .Calculation = CalcMode
        End With
    End Sub
    
    
    
    
    


    MY BOOK

    Monday, January 16, 2017 5:35 PM