Skip to main content
Hello, I would like to know how can I do wrap text for all sheet

Hi @ahmed belal​ ,

 

Could you give this a try?

 

Set xlObj = CreateObject("Excel.Application")

xlObj.visible = False

 

'Filepath goes in here

Set xlFile = xlObj.Workbooks.open(WScript.Arguments.Item(0))

 

'Section which performs the wordwrapping

For Each wk In xlFile.Sheets

  wk.Cells.WrapText = True

Next

 

xlObj.ActiveSheet.Range("A1").Select

 

xlFile.Save

xlFile.Close

xlObj.Quit

 

Kind Regards,

Ashwin A.K


Reply