Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
PowerShellCommunity.org
>
Community Announcements and Assistance
excel doesn't save txt to xml - please help a newbe
Last Post 04 May 2011 04:01 PM by
Poshoholic
. 1 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
ChrisF
New Member
Posts:1
04 May 2011 04:37 AM
hello together, I've got a little problem with a shell I'm writing at the moment and I hope someone of you can give me a hand, cause it is my first script. I tried to get the size of directories into a .txt-file with a batch - no problems
Today my boss told me, that it would be great to get these informations out of txt into an excel table. I looked around a bit, found the powershell and tryed to write a possible script for this and most functions are working... but excel doesn't save the file... not as txt and also not as a xml.
what coul be my prob? It would be great if someone could help me.
here the code:
if($excel){
$excel.Application.DisplayAlerts = $false
$excel.quit()
$ExcelProcess=get-process excel
$ExcelProcess | foreach {stop-process ($_.id)}
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($excel) | out-null
}
$xlo=New-Object -comobject excel.application
$xlo.visible=$true
$xlo.Workbooks.OpenText("directory\test_old.csv")
start-sleep 4
$file=("directory\test.xlsx")
$workbook.SaveAs($file)
$excel.DisplayAlerts = $False
$excel.quit()
$ExcelProcess=get-process excel
$ExcelProcess | foreach {stop-process ($_.id)}
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($excel)
thx a lot
Chriz
Poshoholic
PowerShell MVP, Community Director
Basic Member
Posts:111
04 May 2011 04:01 PM
Hello,
This forum is for community announcements and assistance with the community site only. It is not for general PowerShell questions. Please post your question in one of the general PowerShell forums.
Thank you,
Kirk Munro [
MVP
]
Poshoholic
My blog:
http://poshoholic.com
Follow me on Twitter:
http://twitter.com/poshoholic
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Active Directory
--Exchange Server
--Lync Server
--SharePoint
--SQL Server
--System Center
--Non-Microsoft Products
--Books, Tools, and Videos
--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
>
PowerShellCommunity.org
>
Community Announcements and Assistance
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2