Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
Reformatting Excel Columns
Last Post 07 Jun 2010 12:56 PM by
dgolliner
. 0 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
dgolliner
New Member
Posts:3
07 Jun 2010 12:56 PM
I'm a newbie to powershell, and have been given the duty of learning powershell so that I can create a file loading process into sql. I'm wanting to create a script that opens csv files in excel 2007, reformat the columns to all "text" so that when i save the file, every field is has a text qualifier. Could use a little help trying to point me in the right direction when it comes to the reformatting portion. Here is the excel connection code:
$xlExcel8 = 56
$Excel = New-Object -ComObject excel.application
$Excel.visible = $False
$Excel.displayalerts=$False
$WorkBook = $Excel.Workbooks.Open("C:\users\dgolliner\desktop\item_vend_pkg_factor_temp.csv") $WorkSheet = $Workbook.worksheets.Item(1)
$WorkSheet.UsedRange.FormatConditions.ToString ??????????
$Resize = $WorkSheet.UsedRange
$Resize.EntireColumn.AutoFit()
$WorkBook.SaveAs("C:\users\dgolliner\Desktop\ivpf.csv", $xlExcel8)
$Excel.quit()
Thanks
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2