Clear Clipboard on file.close 
Author Message
 Clear Clipboard on file.close

I have a VBA script in Word that opens an Excel file, copies info and pastes
it into the Word document, then closes the Excel file.  When I close the
Excel file, I always get a prompt about "..large amount of info on
clipboard, do you want to save it?"  How can I bypass this message or clear
the clipboard using VBA??    Right now, I close the file using:

xlbook.close savechanges:=False

Thanks in advance,
Gina Frazier



Mon, 23 Dec 2002 03:00:00 GMT  
 Clear Clipboard on file.close

Use Clipboard.Empty after you are done pasting.

-Derek


Quote:
> I have a VBA script in Word that opens an Excel file, copies info and
pastes
> it into the Word document, then closes the Excel file.  When I close the
> Excel file, I always get a prompt about "..large amount of info on
> clipboard, do you want to save it?"  How can I bypass this message or
clear
> the clipboard using VBA??    Right now, I close the file using:

> xlbook.close savechanges:=False

> Thanks in advance,
> Gina Frazier




Tue, 14 Jan 2003 03:00:00 GMT  
 Clear Clipboard on file.close

Hi Derek,

Although VB6 has a Clipboard object, Word VBA and Excel VBA don't. This is
how to do it in VBA.

Dim MyData As DataObject
Set MyData = New DataObject
MyData.SetText ""
MyData.PutInClipboard

Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email

Quote:

>Use Clipboard.Empty after you are done pasting.

>-Derek



>> I have a VBA script in Word that opens an Excel file, copies info and
>pastes
>> it into the Word document, then closes the Excel file.  When I close the
>> Excel file, I always get a prompt about "..large amount of info on
>> clipboard, do you want to save it?"  How can I bypass this message or
>clear
>> the clipboard using VBA??    Right now, I close the file using:

>> xlbook.close savechanges:=False

>> Thanks in advance,
>> Gina Frazier




Tue, 14 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Access XP: Clearing the clipboard / not saving data to the clipboard

2. Closing a file and clearing a dblist

3. Clearing the clipboard/memory

4. Clear the clipboard

5. Clipboard.clear

6. Clearing the clipboard from Access

7. Clear Clipboard

8. Clipboard.Clear - Returns Error 424 - Object Required

9. clear clipboard

10. Clearing the Clipboard

11. Clearing the Clipboard Contents

12. clear clipboard

 

 
Powered by phpBB® Forum Software