> For the complete documentation index, see [llms.txt](https://saveenr.gitbook.io/visiopowershell/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://saveenr.gitbook.io/visiopowershell/cmdlets/shapecells/working-with-shape-cells.md).

# Shape cells

To read the cell values of a shape, use [`Get-VisioShapeCells`](/visiopowershell/cmdlets/shapecells/get-visioshapecells.md). It returns a `System.Data.DataTable`.

To write cell values, first create a `ShapeCells` object with [`New-VisioShapeCells`](/visiopowershell/cmdlets/shapecells/new-visioshapecells.md). Set the properties you care about. Finally, hand the object to `Set-VisioShapeCells`.

### Working with shape cells

```powershell
# First, let's draw a shape on a page

Set-StrictMode -Version 2
$ErrorActionPreference = "Stop"

Import-Module Visio

New-VisioApplication
$doc = New-VisioDocument

$basic_u = Open-VisioDocument "basic_u.vss"
$master  = Get-VisioMaster "Rectangle" -Document $basic_u
$shape   = New-VisioShape -Master $master -Position (New-VisioPoint 2 2)

$cells_dt = Get-VisioShapeCells -Shape $shape

Write-Host $cells_dt

$new_cells = New-VisioShapeCells
$new_cells.XFormWidth  = 2
$new_cells.XFormHeight = 4

Set-VisioShapeCells -Cells $new_cells -Shape $shape
```
