Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2010 "this image cannot currently be displayed" 'Running' macro 1

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
GB
The following part of this code gives me the above error:-

Code:
            Range("a" & 1 + HeaderRow, Cells(SourceEndRow, SourceEndCol)).Copy
        
            End With
    
    SourceWb.Close savechanges:=False
    
    Windows(OriginalWorkBook).Activate
    Sheets(1).Range("A" & OEndRow + HeaderRow).PasteSpecial Paste:=xlPasteAll

If I step through the code (F8) it seems to work just fine but if I either 'F5' or run it (completely) from a button, the destination sheet just has a rectangle with a red 'x' in the upper left corner with the message
Code:
 this image cannot currently be displayed
in it.

If I add a 'Toggle Breakpoint' at the
Code:
 copy
line and then 'F8' to the next line, I can F5/Run from there just fine. If I move the 'Toggle' to the
Code:
 paste
line & F8 from there the error still occurs.

Both of these files are on a network drive - but I can't see the significance of that!

Any ideas?

Many thanks,
Des.
 



Try this...
Code:
            Range("a" & 1 + HeaderRow, Cells(SourceEndRow, SourceEndCol)).Copy
            thisworkbook.Sheets(1).Range("A" & OEndRow + HeaderRow).PasteSpecial Paste:=xlPasteAll

            End With
    
    SourceWb.Close savechanges:=False

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
All Riiighttt!!!!!

Many thanks Skip.

Des.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top