Powershell中的excel自动化Vlookup函数

时间:2018-07-06 14:19:14

标签: excel powershell powershell-v3.0 powershell-v4.0 powershell-remoting

powershell脚本可自动执行无法执行Vlookup功能的excel功能, 我输入了两张Excel文件

**sheet1**  - machinename,status
**Sheet2**  - machinename,lastlogontime

我需要在 sheet2 中进行vlookup才能从

获取状态
sheet1=VLOOKUP(A2,final!A:B,2,FALSE)

我想在以下代码的 powershell 中使用相同的公式。

下面的代码给出错误“您不能在空值表达式上调用方法”

$v1 = "VLOOKUP(A2,'C:\Users\vtamilar\Desktop\UK[final.xlsx]'final!`$A:`$B,2,FALSE)"

$wb2.cells.item(2,3).value2 = $v1

0 个答案:

没有答案