Hi Team,
I am facing an error while creating Excel file using powershell script.
My requirement is to create excel sheet with two workbooks and add some columns and rows to each workbook.
When I run the same code using "Windows powershell ISE", it is working without any issues. But not from CPO activity.
When I use:
$excel = New-Object -comobject Excel.Application
$workbook = $excel.Workbooks.Add()
Results in error:
Exception calling "Add" with "0" argument(s): "Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space. • To make more memory available, close workbooks or programs you no longer need. • To free disk space, delete files you no longer need from the disk you are saving to."At C:\Reporting\Temp\PO_WorkingDir_7bdb6c15-43c4-49b6-8049-d22243a77844\PO_PSScript_7bdb6c15-43c4-49b6-8049-d22243a77844.ps1:35 char:1+ $RequisitionWorkbook = $ExcelObject.Workbooks.Add()+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ComMethodTargetInvocation
Please find the attached screen shot for image reference. Could anyone provide the support to resolve this?
Note: We are sure the server is dfinitely not lacking for resources..
Regards,
Vignesh