Skip to main content
Question

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

  • March 28, 2022
  • 1 reply
  • 31 views

  • Navigator | Tier 3
  • 50 replies
Hello, I would like to know how can I do wrap text for all sheet

1 reply

Ashwin A.K
Forum|alt.badge.img+8
  • Navigator | Tier 3
  • 2445 replies
  • March 28, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings