How to Set Column width in Excel

Hello @iumerparay,

After writing data in excel, you want to auto-fit the column right?
Then, using Invoke VBA could be a option.

firstly write the code below in txt file.

Sub ColumnWidth()
Columns("H:H").EntireColumn.AutoFit
End Sub

Then use Invoke VBA activity in excel application scope and mention txt path and methodName e.g here i’ve used ColumnWidth just change column in above code as here’s H.

image

5 Likes