I have an excel , there are some charts and would like to copy to word .
$workbook = $excel.workbooks.open($excelFiles)
$worksheet = $workbook.worksheets.item('LPAR')
$charts = $worksheet.ChartObjects()
$chart = $charts.Item('2')
$a = $chart.copy() <<<<< this line throw exception
Exception calling "Copy" with "0" argument(s): "Exception from HRESULT: 0x800A03EC"
At line:1 char:12
+ $chart.copy <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
There are 3 charts in the sheet, I can do $chart = $charts.Item('1') .
but $chart = $charts.Item('2') . $chart = $charts.Item('3') . get the same error.
any idea . ??
it's excel and word 2016