0

When I embedding an OLEObject (Word/XLS/PDF doc) into Excel via powershell, I'm unable to save the excel file (I'd like to save manually, not via PShell - but does not work automatically either). If I insert object like *.txt, png,jpeg - there is no problem with saving the target excel file (both auto and manually saving works).

Any idea? Thanks.

The relevant part of the code is:

$missing=[System.Type]::missing

$excel = New-Object -ComObject Excel.Application
$excel.visible=$true
$wrkbook = $excel.Workbooks.Add()
$wrksheet = $wrkbook.Worksheets.Item(1)
$file = ("link")

  $icon =$wrksheet.OLEObjects().Add($missing,$file,$false,$false,$missing,$missing,$missing,$missing,$missing,$missing,$missing)
kegloadam
  • 11
  • 2
  • Welcome to StackOverflow. Please take a look at [tour] and [ask] and try to offer an [mcve] of what you tried so that others can understand easier where the probleme is. – Paxz Aug 21 '18 at 11:18
  • Thanks for your advice. Is it appropriate now? :) – kegloadam Aug 21 '18 at 12:14
  • Yeah thats better! It probaly would be even better if you would show how you save the file ;) – Paxz Aug 21 '18 at 12:23
  • Thanks, post corrected with more details (I'd like to save manually - not via PS). I hope someone can help in it. :) – kegloadam Aug 21 '18 at 12:42

0 Answers0