Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

Word(97) VBA error 5668

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
VBALover - 28 Dec 2004 14:02 GMT
Hi All,

I wrote a macro in word(97 OSR2)  to insert a row in a table and reset the
cells
format to what I want. This macro works fine with hotkey.

But if I execute the macro with many time (lets say crazyly hit the hotkey
many many times in  a second), the error come out.

"execution stage error '5668':
"The format in this document settingis too complicated. Please save it
immediately"
(Originally is in Chinese)

I can end this error and then run the macro again without any error. However
if I run it crazyly again, same erros occurs.

If I run it slowly (one by one), error never happen.

What is happening?? What can I do to skip this error?

Thanks for advice!
Jonathan West - 28 Dec 2004 14:30 GMT
Hi VBALover,

Tables are complex beasts, and all that is happening is that you aren't
giving Word dime to catch up with what you are asking. Include a few
DoEvents commands in the macro just to give Word more of a chance to keep up

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

> Hi All,
>
[quoted text clipped - 19 lines]
>
> Thanks for advice!
VBALover - 29 Dec 2004 15:07 GMT
Thanks for your advice first. However I am not so smart to udnerstand what
you said. Can you give me more examples (or a example) of what you say, pls
~~

Million Thanks ~

> Hi VBALover,
>
[quoted text clipped - 25 lines]
> >
> > Thanks for advice!
Jonathan West - 29 Dec 2004 23:41 GMT
> Thanks for your advice first. However I am not so smart to udnerstand what
> you said. Can you give me more examples (or a example) of what you say,
> pls

Just include the following 3 lines at the end of your macro

DoEvents
DoEvents
DoEvents

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Jonathan West - 29 Dec 2004 23:42 GMT
> Thanks for your advice first. However I am not so smart to udnerstand what
> you said. Can you give me more examples (or a example) of what you say,
> pls

Just include the following 3 lines at the end of your macro

DoEvents
DoEvents
DoEvents

The idea behind this is to tell Windows to catch up with what has been going
on in Word.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

VBALover - 01 Jan 2005 13:53 GMT
Oh.... let me try it first. Thanks ~~~

^_^

> > Thanks for your advice first. However I am not so smart to udnerstand what
> > you said. Can you give me more examples (or a example) of what you say,
[quoted text clipped - 8 lines]
> The idea behind this is to tell Windows to catch up with what has been going
> on in Word.
VBALover - 02 Jan 2005 18:14 GMT
oh... I fail..

the error still com out.. Any  more suggestion?

here is my code:
' reset format for 4th Col
With Selection.Cells
       DoEvents
       With .Borders(wdBorderLeft)
           .LineStyle = wdLineStyleSingle
           DoEvents
           .LineWidth = wdLineWidth150pt  '<--- Error always come out from
this line
       End With
       DoEvents
       With .Borders(wdBorderRight)
           .LineStyle = wdLineStyleSingle
           .LineWidth = wdLineWidth050pt
       End With
       .Borders(wdBorderTop).LineStyle = wdLineStyleNone
       .Borders(wdBorderBottom).LineStyle = wdLineStyleNone

   End With
   With Options
       .DefaultBorderLineStyle = wdLineStyleSingle
       .DefaultBorderLineWidth = wdLineWidth050pt

   End With

   Selection.Font.Bold = False

> > Thanks for your advice first. However I am not so smart to udnerstand what
> > you said. Can you give me more examples (or a example) of what you say,
[quoted text clipped - 8 lines]
> The idea behind this is to tell Windows to catch up with what has been going
> on in Word.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.