vb.net 2003
excel 2003
What I need:
Select Columns G ang H
Format the Column to WrapText in the excel sheet
' current code from .net
XL.Visible = True 'open excel
xlWB = XL.Workbooks.Open(xlPath) 'open the workbook
xlWS = xlWB.Worksheets("GPS Worksheet") 'set the worksheet
Dim SpecialChars As String = "!@#$%^&*()_+-={}|:<>?,[]./;"
Dim Rng As Excel.Range
' delete special characters
With xlWS
Rng = XL.Intersect(.Range("A:A"), .UsedRange)
End With
For r As Integer = 1 To Rng.Rows.Count
For c As Integer = 0 To SpecialChars.Length - 1
Rng.Cells(r, 1).Value = Rng.Cells(r, 1).Value.ToString.Replace(SpecialChars.Chars(c), "")
Next
Next
' make the call to run
xlWB.Application.Run(mcrName)
'<------------------- ' run the code to wraptext here...
Thanks
fordraiders
Our community of experts have been thoroughly vetted for their expertise and industry experience.