Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting Column CellFormats in a script file
Hi
Im writing a script file to convert a CSV to a XLS and format some of the columns into a particular date format. So far this is where I'm at: Dim appExcel Dim wbSource On Error Resume Next Set appExcel = CreateObject("Excel.Application") appExcel.DisplayAlerts = False Set wbSource = appExcel.Workbooks.Open("C:\temp\Comm.csv") wbSource.SaveAs "C:\temp\Comm.xls", 39 wbSource.Close False Set wbSource = Nothing appExcel.Quit Set appExcel = Nothing This converts the CSV to a XLS, but I don't know how to format the columns to a custom (dd/mm/yyyy) date format (btw, the data starts on the 2nd line of the spreadsheet since the first line is headings). Anyone with any ideas? Thanks Jimi |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Converting Column CellFormats in a script file
Jimi
Put a select statement in and then With Selection .NumberFormat = "dd/mm/yy" End With Regards Peter -----Original Message----- Hi Im writing a script file to convert a CSV to a XLS and format some of the columns into a particular date format. So far this is where I'm at: Dim appExcel Dim wbSource On Error Resume Next Set appExcel = CreateObject("Excel.Application") appExcel.DisplayAlerts = False Set wbSource = appExcel.Workbooks.Open ("C:\temp\Comm.csv") wbSource.SaveAs "C:\temp\Comm.xls", 39 wbSource.Close False Set wbSource = Nothing appExcel.Quit Set appExcel = Nothing This converts the CSV to a XLS, but I don't know how to format the columns to a custom (dd/mm/yyyy) date format (btw, the data starts on the 2nd line of the spreadsheet since the first line is headings). Anyone with any ideas? Thanks Jimi . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. | Excel Discussion (Misc queries) | |||
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. | Setting up and Configuration of Excel | |||
How to do something in an VBS script for all worksheets of an Excel file? | Excel Discussion (Misc queries) | |||
VB script for converting each worksheet into individual pdf files. | Setting up and Configuration of Excel | |||
Create an .xls file by script | Excel Programming |