Forum Discussion

Anthony_Antonacci's avatar
Anthony_Antonacci
Copper Contributor
Sep 26, 2024

Range borders in Excel

Hi, 

 

Trying to add a simple Border around a table in Excel using Graph. 

i tried multiple combinations from API docs but i cant get it to work 😞 

 

any help would be greatly appreciated. 

Trying this command (i know its not documented on the api page, but almost non of them are when it comes to sharepoint access) 

$url= "https://graph.microsoft.com/v1.0/drives/{drv}/items/{id}/workbook/worksheets/sheet1/range(address='B3:C4')/format/borders(edgeLeft)"
 
pushing this simple body 
$body='[{"color":"#000000","style":"Continuous","weight":"Medium"}]'
 
getting a BadRequest Back... i'm sure its a small detail i'm missing.... 

2 Replies

  • Forgot to Mention, the "get" command works, same thing but in get format
    https://graph.microsoft.com/v1.0/drives/{drv}/items/{id}/workbook/worksheets/sheet1/range(address='B3:C4')/format/borders

    not sure what happened to my pastese, part of the url is missing 😞
    https://graph.microsoft.com/v1.0/drives/{drv}/items/{id}/workbook/worksheets/sheet1/range(address='B3:C4')/format/borders(edgeLeft)
    • Anthony_Antonacci's avatar
      Anthony_Antonacci
      Copper Contributor
      For those trying to do the same as me (add a broder in a excel file in sharepoint) here is a solution you
      use: .../Range(address='A1:B2')/format/borders('EdgeTop')

      and send Json with only top information.
      this works.... its not really documented anywhere....
      [{"sideIndex":"EdgeTop","id":"EdgeTop", "color": "#000000" , "style": "Continuous", "weight":"Medium"}]

Resources