Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-12-2019, 10:11 PM
diracsbracket diracsbracket is offline Can other applications mess up Copy/Paste in Word VBA script? Windows 7 64bit Can other applications mess up Copy/Paste in Word VBA script? Office 2013
Novice
Can other applications mess up Copy/Paste in Word VBA script?
 
Join Date: Aug 2014
Posts: 5
diracsbracket is on a distinguished road
Default Can other applications mess up Copy/Paste in Word VBA script?

Hi.
I have a script that extracts tables from a series of documents and which takes a rather long time. The tables are extracted via .Copy and .PasteSpecial commands, and thus the clipboard is being used.

However, once in a while, for no apparent reason, the script hangs and needs to be restarted, after which it works fine on exactly the same docs.

Is it possible for other applications using the clipboard to mess each other up? For example, if I copy something in another application, will that mess up the clipboard contents as expected by my VBA script?



Thanks~
Reply With Quote
  #2  
Old 12-12-2019, 11:29 PM
macropod's Avatar
macropod macropod is offline Can other applications mess up Copy/Paste in Word VBA script? Windows 7 64bit Can other applications mess up Copy/Paste in Word VBA script? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What is the destination? If it's another document, you could use the FormattedText property instead of Copy/Paste. See, for example:
https://www.msofficeforums.com/word-...row-paste.html
You'll probably find FormattedText method rather quicker, too.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-13-2019, 08:04 PM
diracsbracket diracsbracket is offline Can other applications mess up Copy/Paste in Word VBA script? Windows 7 64bit Can other applications mess up Copy/Paste in Word VBA script? Office 2013
Novice
Can other applications mess up Copy/Paste in Word VBA script?
 
Join Date: Aug 2014
Posts: 5
diracsbracket is on a distinguished road
Default

@macropod
Thanks a lot! Using FormattedText indeed is much better, smarter, and much faster!
Cheers to you~
Reply With Quote
Reply

Tags
clipboard, ms word, vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can other applications mess up Copy/Paste in Word VBA script? Copy & Paste Word Doc from Excel VBA RMerckling Excel Programming 4 04-18-2018 03:57 PM
Can other applications mess up Copy/Paste in Word VBA script? Word 2016 won't copy and paste Dr. Becky Word 2 05-19-2017 04:59 PM
Copy Text Twice to Paste into word Albundy Word 2 09-02-2016 12:59 PM
Can other applications mess up Copy/Paste in Word VBA script? Cut, copy and paste - why so different from Microsoft Word? mmp997 OneNote 1 10-30-2014 01:34 PM
Word Copy Paste Problem... haxmania1 Word 1 07-30-2009 06:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft