Results 1 to 1 of 1

Thread: [RESOLVED] - how to import a csv file into Excel with VBA only

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    8

    [RESOLVED] - how to import a csv file into Excel with VBA only

    so far i got this part...

    can anyone help me out here?


    Code:
    Set oExcel = New Excel.Application
    
    oExcel.Workbooks.Add
    oExcel.Sheets.Add
    oExcel.Visible = True


    ' thanks to another post i found this and it works fine.
    Code:
    With oExcel
            .WindowState = xlMinimized
           ' .Visible = False
            'hide excel alerts msgboxes
            .DisplayAlerts = False
            .Workbooks.OpenText FileName:="c:\sampleCSV.txt", _
                Origin:=xlWindows, _
                StartRow:=1, _
                DataType:=xlDelimited, _
                TextQualifier:=xlDoubleQuote, _
                ConsecutiveDelimiter:=False, _
                Tab:=False, _
                Semicolon:=False, _
                Comma:=True, _
                Space:=False, _
                Other:=False
    End With
    Last edited by ZeBula; Oct 27th, 2003 at 12:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width