Copy from Word on clipboard

M

Mats Nilsson

Hi everybody,
I have made a routine where a worddocument is copied and pasted in an Excel
Sheet. When it´s pasted I will close down the copied selection on clip board
and close down Word.
i can´t clear the clipboard from the wordcopy and of that reason it´s not
possible to close down the Word Application (there is a question if the
clipboard copy should be saved). In Excel I use "Application.CutCopyMode =
False" but it does not work in this case.
Thanks in advance for any answer how I could solve this problem.
Best Regards
Mats
 
C

chijanzen

Mats Nilsson:

try, EmptyClipboard Api Function

e.g.

Private Declare Function OpenClipboard Lib "user32" (ByVal hWnd As Long) As
Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Public Sub JustEmptyClipboard()
OpenClipboard (0)
EmptyClipboard
CloseClipboard
End Sub
 
J

Jon Peltier

In your routine, insert a line like

wdApp.DisplayAlerts = False

before closing the file and quitting Word, which should suppress the warning
message.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

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