Autofit colums in csv file and save

Home Forums Scripting General Scripting Autofit colums in csv file and save

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    ekrengel
    Member
    #121422

    I am trying to creat a script that will open up a current .csv file, auto fit all the columns and save it. Here is what I have so far but I cannot get it to work.

    Code:
    Set objExcel = CreateObject(“Excel.Application”)
    Set objWorkbook = objExcel.Workbooks.Open(“C:Documents and SettingsBallpark.csv”)

    objExcel.Visible = True

    Set objRange = objExcel.Range(“A1:H1”)
    objRange.Autofit()

    objExcel.Quit

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.