M
mojo
I need someone to run a test for me. This simple loop causes the performance
to degregate as the number of records added increase.
VBA - Word 2003
Create a Word doc.
Create a table with 10 or more columns.
Insert the loop below as a new module.
Run the macro.
What I see in the status field is rapid additions initially, then a visable
decrease in speed.
Anyone know why?
Public Sub amain
Dim maxrow as integer
Dim r as integer
Set myTable = ActiveDocument.Tables(1)
maxrow = 500
While r <= maxrow
StatusBar = "Please Wait - Writing Data Record " & r & " of " &
maxrow & " --|"
myTable.Rows.Add
r = r + 1
Wend
End Sub
Thanks,
MoJo
to degregate as the number of records added increase.
VBA - Word 2003
Create a Word doc.
Create a table with 10 or more columns.
Insert the loop below as a new module.
Run the macro.
What I see in the status field is rapid additions initially, then a visable
decrease in speed.
Anyone know why?
Public Sub amain
Dim maxrow as integer
Dim r as integer
Set myTable = ActiveDocument.Tables(1)
maxrow = 500
While r <= maxrow
StatusBar = "Please Wait - Writing Data Record " & r & " of " &
maxrow & " --|"
myTable.Rows.Add
r = r + 1
Wend
End Sub
Thanks,
MoJo