Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Capturing a Filename and Using Later

$
0
0

Bear with me here, I’m working with powershell for the first time. Goal: open a csv file, and overwrite the same file. Here’s what I have so far:

$excel = New-Object -ComObject excel.application $excel.visible = $true $wb=$excel.Workbooks.Open($csvfile) $wb.SaveAs('c:file.csv') 

This, unfortunately, saves the file as ‘file.csv.’ How do I capture the name of the file being opened?

submitted by /u/dopnyc
[link] [comments]

The post Capturing a Filename and Using Later appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images