A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
The error message "Run time error 4198" indicates that there is a problem with the clipboard. This error can occur if there is no data on the clipboard or if the data on the clipboard is not compatible with the application.
To resolve this issue, you can try copying some data to the clipboard manually and then running the code again. Alternatively, you can try using the PasteSpecial method instead of the Paste method to paste the data.
Here is an example of how to use the PasteSpecial method:
=========================================
Doc.Range.Characters.Last.PasteSpecial DataType:=wdPasteText
==========================================