ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy a named range from an installed add-in while in anothter work (https://www.excelbanter.com/excel-programming/380643-re-copy-named-range-installed-add-while-anothter-work.html)

Chip Pearson

Copy a named range from an installed add-in while in anothter work
 
Seth,

An XLA is never visible, so you can never use Select on any range within it.
You can copy the range directly. E.g.,

ThisWorkbook.Names("CEMergeDataHeader").RefersToRa nge.Copy

ThisWorkbook refers to the workbook or add-in containing the code,
regardless of what workbook happens to be active.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Seth Schwarm" wrote in message
...
Excel XP

I want to copy (not paste, copy only) a named range located in an Add-In
(XLA) which is installed while in any other workbook file.

The Add-In I am referencing creates a new menu in Excel at Open of any
workbook. To run the subprocedure to copy the range - I select a command
from the menu which is created at Open as a result of the Add-In I have
mentioned.

I created a new macro to see what the VBA code would look like and this is
what it looks like:

Application.Goto Reference:="CEMergeDataHeader"
Selection.Copy

When I select the command in the menu created at Open - I receive Error
1004.

Please help.

Thank you - Seth





All times are GMT +1. The time now is 07:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com