Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Below Script to automate Excel runs fine if PIA are not installed.
$xl=new-object -comObject Excel.Application $file="D:\test\test.csv" $xl.visible = $true $wbk = $xl.Workbooks.Open("$file") $wks = $wbk.worksheets.item(1) $r1=$wks.Range("A1:D1") $r2=$wks.Range("A2:D2") $xl.Union($r1, $r2) If PIa are installed it fails on line $xl.Union($r1, $r2). I determined that it's happening because Windows Powershell is not able to typecast _ComObject to Microsoft.Office.Interop.Excel.Range. Any pointers? thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Add-In Automation Fails in Excel 2000 | Excel Programming | |||
Excel and PowerShell | Excel Discussion (Misc queries) | |||
Excel fails to open workbook using Automation from VB 6 | Excel Programming | |||
What needs to be installed on the server for excel automation? | Excel Programming |