I know how to reference existing names using the RANGE function but how can I create a new defined name using Powershell?
My specific case involves defining a name for a single cell with a workbook scope. Just as if you were to right-click a cell in Excel and choose Define Name.
The closest I've gotten is the NAMES object for the workbook but when I "gm" that all I see is a method for delete - nothing for adding.
$xlsx = "c:\Sample.xlsx" $excel = new-object -comobject Excel.Application $xlb = $excel.Workbooks.Open($xlsx) $xlb.names | gm