I am running the ff. script – its purpose is to blank out some cells in an EXCEL file 'MyFile.xlsx' and Save it to the same:
It looks like what is happening is you are not calling the Save() method but outputting the reference to the save method which is showing you the list of valid overloads for Save.
Many thanks Jim ...
I dug further into the MS Technet wesbites and it turns out there is no Save() method for Worksheets — but there is a Save() method for Workbooks.
I do not really know the root cause ... but perhaps that may explain why I got those 3 or 4 extra lines with the "Overload Definitions" message. As suggested I changed Line 9 of the code in the Forum post to:
and it executed without errors. But when I attempted to open the resultant file, it (EXCEL) gives an error message about the file type being the wrong type or is corrupted. This is the same behavior as another earlier problem which I posted before this one, and for which the solution that works (thanks to another Forum participant) is:
$Excel.Workbooks.Item(1).SaveAs(,51) <<< the '51' is to Save to .XLSX Open XML format with Item(1) being the worksheet in question. Many thanks for your inputs, they have led me to more interesting insights and discoveries. Much appreciated! Best,
You must be logged in to reply to this topic.