Results 1 to 4 of 4

How to avoid message about leaving data in clipboard?

Threaded View

  1. #1
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    How to avoid message about leaving data in clipboard?

    I am creating a program that opens an excel file on the network, copies data from a worksheet from that workbook on to ThisWorkbook and then closes the workbook on the network.
    Everything seems to work fine except that when I close the workbook on the network, it displays a message asking if I want to leave the data on the clipboard for future use.

    What code do I need to avoid getting this message? I would like to close the workbook without leaving anything in the clipboard, but I don't want the user to see this message.

    Here's the code that opens the workbook and copies data.

    Workbook.Activate FileName 
                 Worksheets("Input").Activate
                 Range("C1:F103").Copy
                
    ThisWorkbook.Activate
    Worksheets("PASTE TIP SHEET HERE").Select
    Range("C1:F103").Select
    
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    
    
    Workbooks(FileName).Close SaveChanges:=False




    I am sure there is probably a more efficient way to do this and avoid getting the message.

    Thanks for any help I can get.
    modytrane
    Last edited by modytrane; 04-05-2010 at 03:20 PM. Reason: Solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1