H
Helena
Hi everyone,
I have a macro that worked fine for many months in Word 2002, now I switched
to 2003 and it gives me 4198 Command failed error. The macro has a function
that takes a text form field copies it and then pastes "over" it using
pastespecial and plain text.
The part of the macro that is problematic is the pastespecial command.
Originally I had:
Selection.PasteSpecial DataType:=wdPasteText
I got an error that the clipboard was either empty or the content invalid.
So I thought it was because the syntax changed. I recorded a similar macro,
then replaced the above line with:
Selection.PasteAndFormat (wdFormatPlainText)
It works the first time it runs the function (the first text field), but the
second time it runs the function the same exact line returns the 4198 Command
Failed error.
I used the "Step Into" option to possibly find the problem and wouldn't you
believe it I never got the error that way!!!
I found another group on the Internet and a person with a similar problem.
Someone said that since it runs fine with "Step into" it is Word's internal
problem and to try using DoEvents several times, to help the system finish
its processing before pasting. I tried DoEvents, just once, then multiple
times. Well, it does not work either.
Does anyone know either whether there is a "patch" fixing this (couldn't
find anything on Microsoft support page) or if there is a work-around?
By the way, I strongly dislike the fact that Microsoft charges for every
support question, and they don't even have an e-mail to report "their
problems" with the software!
Thanks for any help you can give me with this! Helena
I have a macro that worked fine for many months in Word 2002, now I switched
to 2003 and it gives me 4198 Command failed error. The macro has a function
that takes a text form field copies it and then pastes "over" it using
pastespecial and plain text.
The part of the macro that is problematic is the pastespecial command.
Originally I had:
Selection.PasteSpecial DataType:=wdPasteText
I got an error that the clipboard was either empty or the content invalid.
So I thought it was because the syntax changed. I recorded a similar macro,
then replaced the above line with:
Selection.PasteAndFormat (wdFormatPlainText)
It works the first time it runs the function (the first text field), but the
second time it runs the function the same exact line returns the 4198 Command
Failed error.
I used the "Step Into" option to possibly find the problem and wouldn't you
believe it I never got the error that way!!!
I found another group on the Internet and a person with a similar problem.
Someone said that since it runs fine with "Step into" it is Word's internal
problem and to try using DoEvents several times, to help the system finish
its processing before pasting. I tried DoEvents, just once, then multiple
times. Well, it does not work either.
Does anyone know either whether there is a "patch" fixing this (couldn't
find anything on Microsoft support page) or if there is a work-around?
By the way, I strongly dislike the fact that Microsoft charges for every
support question, and they don't even have an e-mail to report "their
problems" with the software!
Thanks for any help you can give me with this! Helena