【发布时间】:2017-11-17 00:04:22
【问题描述】:
我已经看遍了,我似乎无法找到答案。我不想从 A1 到 G8 进行选择,而是希望它在它创建的导入中选择最后 8 个 USED 行。不确定在这里使用什么。
$pathtsv = "C:\xxxxxx.mdf"
$pathxlsx = "C:\xxxxxxxxxxxxxx.xlsx"
$Excel = New-Object -ComObject "Excel.Application"
$Excel.Visible=$true
$Workbook = $Excel.Workbooks.Open($pathxlsx)
$TempWorkbook = $Excel.Workbooks.Opentext($pathtsv)
$temp = $excel.Workbooks.Item(2)
$temp = $temp.Worksheets.Item(1)
$CopyRange = $temp.Range("A1:G8")
$CopyRange.Copy()
提前致谢。
【问题讨论】:
-
在Using Powershell to Append a table to the end of an Excel File (The Last Row) 我想你可以找到你正在寻找的部分解决方案。
标签: excel powershell copy-paste