# VBSript Excel Center Align / Left Align / Right Align

**URL:** <https://forum.robusta.ai/t/vbsript-excel-center-align-left-align-right-align/97>\
**Category:** FAQ\
**Created:** [April 26, 2022, 9:04am UTC](https://forum.robusta.ai/t/vbsript-excel-center-align-left-align-right-align/97 "2022-04-26T09:04:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilayda.ipar](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robusta.ai/ilayda.ipar/32/56_2.png) [@ilayda.ipar](https://forum.robusta.ai/u/ilayda.ipar)\
**Post date:** [April 26, 2022, 9:04am UTC](https://forum.robusta.ai/t/vbsript-excel-center-align-left-align-right-align/97/1 "2022-04-26T09:04:35Z")

</div>

Call vb script activity can center align cells in an excel file. If Excel is to be used in the processor in real life immediately after the call etc., script activity, a timer should be added (Ex: PT5S).

![image](https://europe1.discourse-cdn.com/flex005/uploads/robusta1/original/1X/29bf621f4a846ac07cdfd356b6ae239ebbaee3c4.png)

```auto
Set objXLApp = CreateObject("Excel.Application")

objXLApp.Visible = false

Set objXLWb = objXLApp.Workbooks.Open("C:\Users\Desktop\Test.xlsx")

Set oSheet = objXLWb.Worksheets(1)

 

oSheet.Range("A1:L45").WrapText = True

oSheet.Columns("A:L").VerticalAlignment = -4108            

oSheet.Columns("A:L").HorizontalAlignment = -4108                                       

 

objXLWb.save

objXLWb.close false

objXLApp.Quit

 

Set objXLWb = nothing

Set objXLApp = nothing

```

Justified alignment, right aligns, left align, etc. The following codes can be used to perform operations.

![image](https://europe1.discourse-cdn.com/flex005/uploads/robusta1/original/1X/3e740b9bc309bc7d5123a2aa47d48c2cfd42e471.png)
