Submitted By: Kent Finkle

Creates a custom date format (YYYYMMDD) in an Excel spreadsheet.

PowerShell
Edit|Remove
# Script name: DateFormat.ps1
# Created on: 2007-01-12
# Author: Kent Finkle
# Purpose: How Can I Use Windows PowerShell to Create a 
# Custom Date Format in Microsoft Excel?

$xl = new-object -comobject excel.application
$xl.Visible = $true
$wb = $xl.Workbooks.Add()
$xl.Cells.Item(1,1) = "01/01/2006"
$xl.Cells.Item(1,1).NumberFormat = "yyyymmdd"