Hi,
Currently, I'm working on a PowerShell script which will read data from excel files. reading the cell values is not a problem as long as I use numbered reference (eg. instead o1,1 instead of A1). However, it is easy to add or remove rows/columns and therefore a fixed cell is not desirable.
We decided to used named cells, to fix the problem of adding rows/column. A new problem is the PowerShell script. I can't find an example of reading named cell.
Does anyone kwon whet
her it is possible to use named cell references?
Part of my current code:
$book=$excel.Workbooks.Open($global:filesNames[1].FullName)
$sheet=$book.WorkSheets.item(1)
$Cell=$sheet.Cells.Item(2,1).text #(row,col)
$Cell
What I would like:
$book=$excel.Workbooks.Open($global:filesNames[1].FullName)
$sheet=$book.WorkSheets.item(1)
$Cell=$sheet.Cells.Item("First_Name").text #(named cell)
$Cell
Many thanks in advance
P.s. Vraag staat ook op het Microsoft forum, maar tot op heden nog geen reactie op gehad. Hopelijk hier meer geluk.
Currently, I'm working on a PowerShell script which will read data from excel files. reading the cell values is not a problem as long as I use numbered reference (eg. instead o1,1 instead of A1). However, it is easy to add or remove rows/columns and therefore a fixed cell is not desirable.
We decided to used named cells, to fix the problem of adding rows/column. A new problem is the PowerShell script. I can't find an example of reading named cell.
Does anyone kwon whet
her it is possible to use named cell references?
Part of my current code:
$book=$excel.Workbooks.Open($global:filesNames[1].FullName)
$sheet=$book.WorkSheets.item(1)
$Cell=$sheet.Cells.Item(2,1).text #(row,col)
$Cell
What I would like:
$book=$excel.Workbooks.Open($global:filesNames[1].FullName)
$sheet=$book.WorkSheets.item(1)
$Cell=$sheet.Cells.Item("First_Name").text #(named cell)
$Cell
Many thanks in advance
P.s. Vraag staat ook op het Microsoft forum, maar tot op heden nog geen reactie op gehad. Hopelijk hier meer geluk.