Question about worksheets in an AddIn
Dim oldWb As Workbook
Dim newWb As Workbook
Set oldWb = ThisWorkbook
oldWb.Worksheets("Sheet1").Copy
Set newWb = ActiveWorkbook
oldWb.Worksheets("Sheet2").Copy Befo=newWb.Worksheets(1)
oldWb.Worksheets("Sheet3").Copy Befo=newWb.Worksheets(1)
oldWb.Worksheets("Sheet4").Copy Befo=newWb.Worksheets(1)
The IsAddin property is a property of the workbook , so select the
ThisWorkbook module of your workbook.
--
HTH
RP
(remove nothere from the email address if mailing direct)
"42N83W" wrote in message
...
"Jim Rech" wrote in message
...
Can the worksheets in an AddIn be copied to another workbook?
Certainly. Just think of an add-in as a workbook you can't see. Btw,
to
change a workbook to an add-in and back is just a matter of flipping its
IsAddin property (in the Properties windows in the VBE). You don't have
to do a Save As.
Follow up:
(1) How then would I copy a sheet from the AddIn to a newly created
workbook?
i.e. The user opens Excel and turns on the desired AddIn (if it is not
already on). This creates a new menu item. The user clicks on the new
menu
and selects the first option. This will a) create a new workbook, and
should b) move four sheets from the AddIn to the newly created workbook.
(2) I am not seeing the IsAddin in the Properties window in the VBE. Do
you
mean to change the property programatically? Where exactly is this
property?
Getting closer, but still a ways to go. Thanks!
-gk-
|