Free Microsoft Excel 2013 Quick Reference

"Excel cannot paste the data"

Hi all,

I have a worksheet to upload info into a database that has various validation and database insert macros running in the background. When I try to Cut and Paste rows into my worksheet I first get a box with the title "Microsoft Visual Basic" and the message 'File not found'. When I hit OK in the window another alert window is opened saying "Microsoft Excel cannot paste the data". When this box is closed however the data *is* pasted into the worksheet.

I'm assuming that it must be my VBA code that is causing these alert windows to open, but I don't know enough about Excel to know where to start looking for the problem, any suggestions?


This problem only seems to occur when the data is pasted from a second instance of Excel. Pasting from a seperate workbook in the same excel instance works fine.



I'm getting this error message when trying to paste data "microsoft office
excel cannot paste the data"

please help....


I am unable to paste onto a chart sheet in one workbook; I get the message
Microsoft Excel cannot paste the data

The drawing toolbar controls are also disabled. I have checked all obvious
protection mechanisms - what am I missing?

Shaftesbury (UK)

I copy a lot of screen shots on the internet (Firefox) in order to crop them and use them in Excel. ONLY LAST WEEK did I start having this problem. I use the ALT+PRT SCR option to select what's on one monitor (I have dual) and then usually have no problem pasting into Excel. All of a sudden last week I started getting an error message "Microsoft Office Excel cannot paste the data."

I tried clearing out the clipboard in Excel and the ALT+PRT SCR option will either show a black image in the clipboard, or the clipboard will show "item not collected."

Why is this happening just now? I've been running 2007 for more than 6 months...never had a problem until now.


i have this problem with cut and paste.
I open a new excel document. Then i type in something.
I can then copy (or cut) the data.
But when i try to paste the data, it gives the above error.

What is the problem? Its driving me crazy. i have to use the
paste board now when i want to cut/paste. Argh

I have a large macro that copies and pastes ranges of cells into Word. All worked fine until Office XP SP3 was downloaded and now the error 'Word cannot obtain the data for the Excel.Sheet.8 link' stops the code from working.

The only reference I can find on the web is asking the same question and gives some background:

"Previously (SP2), obtaining the OLE source display name (via IOleLink.GetSourceDisplayName) would return a string of the format "Book1.xls!Sheet1!R1C1:R5C1 for a standard excel selection or Book1.xls!
Sheet1!TestRange if the source was a Named Range (called "TestRange" in this example)."

"Now (SP3) the un-named range behaves as before, but the string returned for the named range is of the form Book1.xls!Sheet1! R1C1:R5C1TestRange (including both the cell reference and the range name)."

"I believe this is an error rather than a deliberate change as attempting to recreate this ole link by passing this string to MkParseDisplayName results in excel returning a syntax error. Hand- editing the display name string back to the original format (Book1.xls! Sheet1!TestRange) works as expected."

"The bug can be recreated using Excel 2003 and Word 2003 as follows:

1) Create a new excel spreadsheet, with and type a number into a cell.
2) Create a named range for the cell.
3) Copy the cell to the clipboard
4) Create a new word document and select Edit -> Paste Special
5) Choose 'Paste Link' and choose any data format you like (eg. Unformatted Unicode Text) and press OK"

"Get an error: "Word cannot obtain the data for the Excel.Sheet.8 link". As far as I can tell there is no way to get more error detail from word. But if you repeat the above steps but without the named range everything works correctly. Similarly, once you have a working link in word if you press Alt+F9 to view field codes and edit the field code to use the named range then it also works."

I can't find any reference to the the error I have on Mr Excel or the wider web other than this. Really hope someone can help.

Thanks in advance.

THe file runs great on a local directory but after I moved it to the networked location I ran into some issues.

I get and error that:

Microsoft Excel cannot access the file 'H:Supply OperationsApheresis Network ManagementAph Monitor ReportsMonitoring ReportsReports200_22552-01_10252010.xls'. There are several possible reasons:
The file name or path does not exist
The file is being used by another program. The issue is that the file in question is not even on that drive, the reports folder is empty! I even looked for hidden files etc.

Is it possible that Excel is cacheing the filename?

Sub LoopDirLoopFiles3a() 
    Dim wbOpen As Workbook 
    Dim wbMaster As Workbook 
    Dim strDirSub As String 
    Dim strExtension As String 
    Dim oFS As New FileSystemObject 
    Dim oDir 
    Dim strDir 
    Dim oSub 
    Dim lngRowT As Long 
    Dim lngRowB As Long 
    Dim lngRowN As Long 
    Const lngColT As Long = 254 
    Dim wsTarget As Worksheet 
    Dim wsBatch As Worksheet 
    Dim wsNote As Worksheet 
    Dim strMasterName As String 
    Dim strTargetName As String 
    Dim intX1 As Integer 
    Dim intX2 As Integer 
    Dim intMatch As Integer 
    Dim CopiedSht As Collection 
    Dim Sht 
    Call ClearData 
     'Comment out the 4 lines below to debug
    Application.DisplayAlerts = False 
     'Application.ScreenUpdating = False
     'Application.Calculation = xlCalculationManual
     'On Error Resume Next
    Set wbMaster = ThisWorkbook 
    Set wsBatch = wbMaster.Worksheets("Batch") 
    Set wsNote = wbMaster.Worksheets("Note") 
    strMasterName = wbMaster.Name 
    strTargetName = wsNote.Range("A6").Value 
    lngRowB = wsBatch.Cells(Rows.Count, 1).End(xlUp).Row 
    strDir = wbMaster.Path 
    ChDir strDir 
    lngRowN = 10 
    Set CopiedSht = New Collection 
    Do While Len(wsNote.Cells(lngRowN, 1).Value) > 0 
        CopiedSht.Add Item:=Cells(lngRowN, 1).Value 
        lngRowN = lngRowN + 1 
     'MsgBox CopiedSht.Count
    Set oDir = oFS.GetFolder(strDir) 
    For Each oSub In oDir.SubFolders 
         'MsgBox oSub.Path
        ChDir oSub.Path 
        strExtension = Dir("*.xls*") 
        strDirSub = oSub.Path & "" 
        Do While strExtension  "" 
            intMatch = 0 
            For intX1 = 1 To CopiedSht.Count 
                If strExtension = CopiedSht.Item(intX1) Then 
                    intMatch = 1 
                End If 
            Next intX1 
            If intMatch = 0 Then 
                [B]      Set wbOpen = Workbooks.Open(strDirSub & strExtension) 'ERROR ON THIS LINE[/B]
                For intX2 = 1 To wbOpen.Worksheets.Count 
                    wbOpen.Worksheets(intX2).Visible = True 
                Next intX2 
                Set wsTarget = wbOpen.Worksheets(strTargetName) 
                lngRowT = wsTarget.Cells(Rows.Count, 1).End(xlUp).Row 
                If lngRowB = 1 And lngRowT > 0 Then 
                    Range(Cells(1, 1), Cells(lngRowT, lngColT)).Copy 
                    wsBatch.Cells(lngRowB, 1).PasteSpecial Paste:=xlPasteValues 
                    Application.CutCopyMode = False 
                End If 
                If lngRowB > 1 And lngRowT > 0 Then 
                    Range(Cells(2, 1), Cells(lngRowT, lngColT)).Copy 
                    wsBatch.Cells(lngRowB + 1, 1).PasteSpecial Paste:=xlPasteValues 
                    Application.CutCopyMode = False 
                End If 
                lngRowB = wsBatch.Cells(Rows.Count, 1).End(xlUp).Row 
                lngRowN = 10 
                Do While Len(wsNote.Cells(lngRowN, 1).Value) > 0 
                    lngRowN = lngRowN + 1 
                wsNote.Cells(lngRowN, 1).Value = strExtension 
                With wbOpen 
                     '.Sheets(2).Copy after:=wbMaster.Sheets(wbMaster.Sheets.Count)
                    .Close SaveChanges:=False 
                End With 
            End If 
            strExtension = Dir 
    Next oSub 
     'MsgBox wbMaster.Name
    Cells(1, 1).Select 
    wbMaster.SaveAs Filename:=strDir & "Master.txt", FileFormat:=xlText 
    Workbooks.Open (strDir & "" & strMasterName) 
    Set wbMaster = Nothing 
    Set wbOpen = Nothing 
    Set wsBatch = Nothing 
    Set wsNote = Nothing 
    Set wsTarget = Nothing 
    Set CopiedSht = Nothing 
    Application.DisplayAlerts = True 
    Application.ScreenUpdating = True 
    Application.Calculation = xlCalculationAutomatic 
    On Error Goto 0 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines

I have a column in Excel with sample items below:


I'll need to remove ".N" from each, so I pick "Replace" command and
enter ".N" replaced with blank.

However, when I select "Replace All", it seems that it cannot find any
".N" because I got the message about "Microsoft Excel cannot find any
data to replace". What's wrong with it?

I have VBA code that creates a report of people assigned to projects. In the source data, the name is split into a LastName and FirstName field. In the report, these are concatenated as LastName & ", " & FirstName. Some projects don't have anyone assigned and in the source data the LastName and FirstName fields are empty for these rows.

I didn't want to have orphaned commas displayed to the user, so at the end of the operation I performed a replace to change ", " to "" using lookat:xlWhole. This worked perfectly until I tested with a dataset that didn't have any unassigned projects. Then I got the message "Excel cannot find any data to replace." This message would be confusing to my users, so I want to prevent it from displaying.

My first attempt was to use Find to check for the orphaned commas:
    Set xlRng = xlWS.Range("B:B")
    Set xlFind = xlRng.Find(what:=", ", lookin:=xlWorksheet, lookat:=xlWhole)
    If Not IsNull(xlFind) Then
        xlRng.Replace what:=", ", replacement:="", lookat:=xlWhole
    End If
In this case xlRng.Replace... is never executed.

My second attempt was to turn off alerts:
    Application.DisplayAlerts = False
    Set xlRng = xlWS.Range("B:B")
    xlRng.Replace what:=", ", replacement:="", lookat:=xlWhole
    Application.DisplayAlerts = True
In this case I still get the same error message, so I guess this is not one of the alerts affected by the DisplayAlerts property.

I'm sure that using Find first is the way to go, but there's obviously something wrong with how I'm using it. Can anyone help me out here?


I need a macro for filtering the data,

When I go one column and Click custom filter and give the command one number and or another numbers ( I Have attached an excel sheet with screen shot) This filters the data, and I need to copy the same and paste in the next sheet.

I have to do like this for about 20 times for 20 sets of data)

I have already done this and pasted the data in sheet2. I did everything manually. ( sample sheet is attached)
I need a macro to do this work for me.
When I run the macro If get 2 text boxes I can enter the numbers. and click ok,the data has to filtered in sheet1, and result has to be pasted in the next sheet.with the header.

Again I will run the macro i will give 2 numbers and the result should be pasted in sheet 2 after the 1st set of data leaveing one row as blank. ( exactly like the sample data in sheet 2)

If I run the macro for 10 times giving 10 different numbers, the result should be pasted one after the other in sheet 2.

I guess bit complecated, I would appreciate If I get helps

Hi Folks

Does anyone know how to paste the data into next blank rows without delete existing data based on user form selection? I have attached a file of what I'm trying to accomplish. Thanks in advance for your expertise!



I am using Excel 2007.

I have a file that had multiple charts in it. When I recently opened it,
all of my charts had vanished. Also, If I try to build new charts, I
highlight the appropriate date but all of the chart options in the ribbon are
grayed out - I can't select one.

Additionally... I have try to copy a chart from another excel file into
this problem file it tells me "Microsoft Office Excel cannot paste the data".

Note, that I can create charts in other Excel files, just not this
particular one.

Any ideas what is causing this? I have a lot of charts in this file and
don't want to recreate them...


Just installed Office 2010.
When I press PrintScrn or ALT+PrintScrn >> move to an open WB and try to Paste the picture (which is, probably, located in the Comp. Clipboard) into whatever sheet -
I get this error:"Microsoft Excel cannot paste the data".
Pasting into a "Word" Document works like charm.
More than that - when I copy that pasted picture (from inside the document) it "agrees" to be pasted onto the WB Sheet.
Does anybody any clue ?
I am aware that the 2010 is a fresh beta version, "still warm from the oven", but maybe one of you faces a similar problem in one of the previous versions.

excel cannot accepted the password and finily cannot open file pz give the
suggestion file open asking to enter password

This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

I have a spreadsheet in which I have added one piece of code to a VB module
(GetFormula). This file also contains many formulas. Other than those two
things, I just have straightforward data and formatting in various cells.

Now when I try to paste into this sheet from another file, I get a VB message:

"File not found"

If I click OK, this message appears:

"Microsoft Excel cannot paste the data"

However, the data is pasted into the target cell(s).

If I click Help, this topic appears:

"Can't find specified file."

What's going on?

I've created a Pivot Table in my macro, with the intention of then copying & pasting the data into another sheet.
However, at current my pivot table looks like this:

Sum of Amount
CPName DealTypeDetailName Total
Abbey Banco Santander FRN 10900000Abbey BSCH International FRN 13000000Abbey National Treasury Service CD 10000000
FRN 15000000Alliance & Leicester Group Tre CD 25000000 FRN 10000000Allied Irish Bank Plc CD 15000000Anglo Irish Bank Corp Plc FRN 11000000ANZ Banking Group Ltd FRN 43000000

Now as you can see for Abbey National for eg there are two types:CD and FRN. If I paste this data somewhere else, there will be a blank entry for the Abbey FRN. So really I want it to say Abbey National twice, next to both CD and FRN.

Have you got any idea how I can do this within the pivot table, or perhaps how I could add a bit into my macro.


• ActiveSheet.Paste Link:=True or ActiveSheet.Paste ,True
• Access 2002 VB Module controlling Excel 2002 spreadsheet
• Used 6 different times per record, up to 24 records per recordset, up
to 40 recordsets
• Works fine on local machine
• Fails when using Remote Desktop Connection with:

Run-time Error ‘1004’:
Microsoft Excel cannot paste the data.

• Consistent failure on this statement
• Inconsistent failure as to which instance/record/records it fails on –
if fails at all (fails more times than not)

I recently changed my HD in my desktop and upgraded the OS from Windows XP Home edition to Windows Vista ultimate. I'm able to open all programns that I was running before except excel. I'm getting the error message "Excel 2007 excel cannot open the file because the file format or file extension is not valid". I have tried to follow suggested solutions posted in the forum but non is conclusive. Please help...anybody...

Hi Folks

Does anyone know how to paste the data into next blank rows without delete existing data based on user form selection? I have attached a file of what I'm trying to accomplish. Thanks in advance for your expertise!


My VBA code needs to import text files and put each one into a new worksheet. I'm currently using the following code to accomplish this:

    Application.DisplayAlerts = False 
    ChDir Path 
    Workbooks.Open Filename:=Path & Name 
    i = i + 1 
    Application.CutCopyMode = False 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
For some reason, it won't run in runtime mode, but it does work in break mode when I step through it. When I run it in runtime mode, I get a "Run-time error '1004': Microsoft Office Excel cannot paste the data." message displayed.

If someone could explain why that little procedure won't work in runtime and why it does in break mode, I'd appreciate it.


I have an interesting problem, that I've pretty much torn most of my hair out debugging. I have a workbook set up in Excel 2003, that reads data from an Access database, crunches a lot of numbers, and creates a lot of charts in another template workbook. After a report is done, my workbook would save the template with it's final name, clear out all the data, and start over with the next report. After X amount of reports, VBA would error out with a "Excel cannot paste the data" error, trying to paste a chart. I worked around this by having my workbook close the template in between reports, and from then on, no errors.

Now, months after the project was done, my client frantically calls me saying that it is crashing. I get a sample of the data he is using, and one report's data is huge. About 75% of the way through the report, Excel crashes with the same error as above. If I end the code execution, I can copy and paste charts to my hearts desire. I tried having it reopen the template workbook when it gets that error, but opening a workbook fails, until I close and reopen the workbook.

In order to work around this, I have my workbook reopening the template workbook about 8 times during the course of generating a report. (Pretty inefficient).

What seems to be the issue, is some resource with the workbook object is getting used up, and doesn't get released until the workbook is closed. I put together a sample of code to showcase this (This requires a blank sheet with one lone chartobject in it):

Public Sub
     Dim wbTest as Workbook
     Set wbTest = ActiveWorkbook

     Application.ScreenUpdating = False

     For a = 1 to 1000
          For b = 1 to 200
               Application.Statusbar = a & " - " & b
          Next b

          For b = 2 to ActiveSheet.ChartObjects.Count
          Next b

     Next a
     Application.ScreenUpdating = True

End Sub
On my machine, this runs until "164 - 166" until it hits a Run-time error 1004. The interesting part of it is, if you end, and run the macro again, it errors out right away. Although this example isn't very practical, it is the same phenomenon I keep running into.

My questions are these:
1. Is there any way to flush the workbook, short of closing it and reopening it?
2. Is there any way to programmatically predict before this happens? Or even monitor it?

Tracking this down has been like hunting down a needle in a forest.

Any help is appreciated.

Okay. I have this one workbook. Just a normal workbook, normal data, normal charts.

But, for some reason, the option of creating a Textbox is "greyed" out. If I open any other workbook, the option is there.

Also, when I try to paste a textbox into one of the chart, I get the error msg saying that "Microsoft Excel Cannot Paste the Data".

Can anyone help?


I need to copy data from an HTML table, which includes ISBN and ISSN numbers,
and paste it into Excel. My problem is that I cannot get Excel to recognise
the leading zeros in the ISBN/ISSNs. Excel formats it as a number as soon as
it is pasted in. If I then select the column with the number in and
re-format it as text, the leading zero does not appear. If I copy and 'paste
as text' into excel, of course the data does not appear in seperate columns.
I've read the advice already in existence on this subject but it doesn't
address my particular problem - I'd be grateful for any help!

I am trying to set up an Access form for users to enter data into an Excel
However, whilst the form will enter new data on initial use, this does not
expand the database and, therefore, any subsequent use will not work as
Access comes up with the error "Cannot expand named range". This is now
because the form has entered data past the original designated database area.
Can anyone tell me what I am doing wrong?

Excel 2000
Access 2000



I try several time to copy a cell then paste the data in another cell but I
If I use "ctr v" I ear a sound but nothing happen, the paste in the ribbon
is greyed out.

But In another files in excel I don't have this kind of probleme.

thank you for your help