View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default How do you import sheets into an Excel XLA Add-In?

Hi Jay,

'--------------------
Joel's solutions work properly and open the addin file, but I'm interpreting
your original post differently.

If I understand your problem correctly, I don't think that it's possible to
import new worksheets into an addin (.xla). The action of making an addin
from a normal workbook converts the workbook into a static XLA file for the
primary purpose of making its VB code internally available to other
workbooks
(without reference to the workbook containing the code). I believe the only
way to modify an addin XLA file is to modify the original workbook file that
was used to create it and save the modified workbook as a new addin XLA
file.
Making an addin is like forging a horseshoe; once it's quenched and
tempered, it can't be changed.

Please correct me if you (or others) have discovered otherwise or my
interpretation is missing the mark.
'--------------------

'=============
Public Sub Demo()
Dim destWB As Workbook
Dim srcWB As Workbook

Set srcWB = ThisWorkbook
Set destWB = Workbooks("Pluto.xla")

With destWB
MsgBox .Sheets.Count
.IsAddin = False
srcWB.Sheets("Sheet1").Copy _
After:=.Sheets(.Sheets.Count)
.IsAddin = True
MsgBox .Sheets.Count
End With
End Sub
'<<=============


---
Regards,
Norman