Computer speed problems?

K

kosmodisk

Hi,

I have created a small application in VBA, that compiles reports -
creates one main document, puts in another docs using "insert word
file", then goes to header, types some text into header, etc etc.

What I'm having here is that on some, and I stress the word "some",
cases - header contains 1x3 cells table, and I need to type stuff into
the 3rd cell - goddamn Word just does not cooperate. So, here is what
I'm doing:

with docReport.ActiveWindow
' go to header
.ActivePane.View.SeekView = wdSeekCurrentPageHeader

' select cell number 1,3
.Selection.Tables(1).Cell(1, 3).Range.Select
'---sinp
end with

On compiling, when report has gained more than n pages, the fun begins.
Cursor just does not go into that cell, it stays at the cell 1,1. I
note that if I break the execution, and do it step-by-step, everything
works fine :)) Also, doing the same thing on another computer, same
Word version and everything, also it works.

So, I have reached no other conclusion than this must be computer speed
problem. Switching to header, the cursor somehow does not manage to
follow the execution of macro, or something.

For a while, if I did select cell for 4 times, it worked :)) Now, even
that does not work. I don't know what to do. Increase to 40 times? :))
Delay the execution (haven't tried it yet, but knowing VBA I dont think
it will help)? Has anybody ever experienced same problem?


Sven
 
H

Helmut Weber

Hi Kosmodisk,

a stab in the dark:

Use the range-object instead of the selection-object.
With using ranges, the cursor,
more pecisely the insertion point,
doesn't move anway.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top