Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
How to do something in an VBS script for all worksheets of an Excel file? Claudia d'Amato Excel Discussion (Misc queries) 9 June 26th 08 10:53 PM
VB script for converting each worksheet into individual pdf files. G Setting up and Configuration of Excel 5 November 23rd 05 03:34 AM
Create an .xls file by script Mark Powell Excel Programming 0 August 14th 03 11:54 PM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"