View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Trefor Trefor is offline
external usenet poster
 
Posts: 201
Default Copy Paste not working from Add-in - Error 1004

The below code is in an add-n, when my main workbook had a reference to the
add-in it worked fine. When I removed the reference, and used RUN to call the
macro it failed as per below. Any ideas?

ThisWorkbook.Names("Data_Main").RefersToRange.Copy
Windows(WorkbookMain).Activate
Sheets("Data").Select
Range("b5").Select
ActiveSheet.Paste <--- errors with Error 1004 Paste method of
Worksheet class failed.

--
Trefor