Hi all
Is there any activity that u can setting some column width and else?
thanks
Hi all
Is there any activity that u can setting some column width and else?
thanks
If you have Excel installed you can use an Invoke VBA
activity with this script:
Function AutoFitColumns(sheetName As String) As String
' AutoFits column widths for all used columns on the specified sheet
On Error GoTo ErrorHandler
With Sheets(sheetName)
.UsedRange.EntireColumn.AutoFit
End With
AutoFitColumns = "Success"
Exit Function
ErrorHandler:
Debug.Print Err.Description
AutoFitColumns = "Error: " & Err.Description
End Function
Save the script in a text file in your project structure. Call the function like this:
Pass your sheet name through EntryMethodParameters like so:
Also, if you’ve never done it before you may need to enable programmatic access, otherwise you’ll probably get an error.
To do this:
You should only need to do this once.