Change excel column width using VB invoke code

excel

#1

Hi,
Please let me know how I can change the width of the excel columns using VB scripting below is sample of same:
Dim excel As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet
Dim wks As Microsoft.Office.Interop.Excel.Worksheets
Dim rng As Microsoft.Office.Interop.Excel.Range
Dim i As Long
Dim theRange As String
excel = New Microsoft.Office.Interop.Excel.ApplicationClass
wb = excel.Workbooks.Open(Path)
excel.Visible=True
‘ws=CType(wb.Sheets(“Output”),Microsoft.Office.Interop.Excel.Worksheet)’
wks(“Sheet3”).Columns(“A”).ColumnWidth = 8


#2

this forum is for UiPath not VB…!!!


#3

See these they might help you -

https://analysistabs.com/excel-vba/change-row-height-column-width/

@skini76 This is the friendliest forum you will ever see, we should try to help each other even if the topic is out of scope and here this particular topic is completely in the scope because UiPath uses VB code. C’mon it is for us ultimately we have to make this forum better everyday


#4

@skini76 LOL… UiPath uses VBS for invoke VBA activity so… let him ask the doubt…


#5

@Pablo_Sanchez - that would be Let her ask the doubt :smiley::smile: I know it is very hard to find this by name only if there is no DP :smiley:


#6

There are forums for VBA and answer is readily available and response to the queries could be faster. I am injecting a java script in UiPath, the java script has errors, so should I post JavaScript related queries ? This way forum will get diluted and will loose significance. My sincere appeal is to restrict queries to UiPath, but no one can stop you from posting queries which are not related to UiPath.