View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Hugh Hugh is offline
external usenet poster
 
Posts: 38
Default Set Cell format using VB.NET

Hi,

I want to open a exsiting CSV file and set the Data Format of column A (Date
and time) to Date (m/d/yyyy) and column width to certain number. I can open
the file but how to set the format? Thanks very much.

My code:

Dim excel As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
excel = New Microsoft.Office.Interop.Excel.Application
wb = excel.Workbooks.Open(FileName)
excel.Visible = True
wb.Activate()