M
mamabear
I tried to run a macro provided by a user named Bob to automatically wrap
text in the task name fields. The macro code I'm trying to run is below. When
I try to run it, I get the following run-time error message:
Run-time error '1101':
The argument value is not valid.
The line of code that is highlighted as the error is:
SetRowHeight unit:=1, Rows:=Str(T.UniqueID), useuniqueid:=True
What should I do to fix this? Thanks for any help!
Sub Auto_wordwrap()
TxtLim = 35
For Each T In ActiveProject.Tasks
If Not T Is Nothing Then
SetRowHeight unit:=1, Rows:=Str(T.UniqueID), useuniqueid:=True
Select Case Len(T.Name)
Case TxtLim To TxtLim * 2
SetRowHeight unit:=2, Rows:=Str(T.UniqueID), useuniqueid:=True
Case TxtLim * 2 + 1 To TxtLim * 3
SetRowHeight unit:=3, Rows:=Str(T.UniqueID), useuniqueid:=True
Case TxtLim * 3 + 1 To TxtLim * 4
SetRowHeight unit:=4, Rows:=Str(T.UniqueID), useuniqueid:=True
Case Is > TxtLim * 4
SetRowHeight unit:=5, Rows:=Str(T.UniqueID), useuniqueid:=True
End Select
End If
Next T
End Sub
text in the task name fields. The macro code I'm trying to run is below. When
I try to run it, I get the following run-time error message:
Run-time error '1101':
The argument value is not valid.
The line of code that is highlighted as the error is:
SetRowHeight unit:=1, Rows:=Str(T.UniqueID), useuniqueid:=True
What should I do to fix this? Thanks for any help!
Sub Auto_wordwrap()
TxtLim = 35
For Each T In ActiveProject.Tasks
If Not T Is Nothing Then
SetRowHeight unit:=1, Rows:=Str(T.UniqueID), useuniqueid:=True
Select Case Len(T.Name)
Case TxtLim To TxtLim * 2
SetRowHeight unit:=2, Rows:=Str(T.UniqueID), useuniqueid:=True
Case TxtLim * 2 + 1 To TxtLim * 3
SetRowHeight unit:=3, Rows:=Str(T.UniqueID), useuniqueid:=True
Case TxtLim * 3 + 1 To TxtLim * 4
SetRowHeight unit:=4, Rows:=Str(T.UniqueID), useuniqueid:=True
Case Is > TxtLim * 4
SetRowHeight unit:=5, Rows:=Str(T.UniqueID), useuniqueid:=True
End Select
End If
Next T
End Sub