Question about accessing worksheets on an AddIn file

  • Thread starter Thread starter 39N95W
  • Start date Start date
3

39N95W

Excel 2002
Windows XP Pro

I am thinking of creating an Excel AddIn file that will compare two
databases (other Excel files actually). My first question is: can I access
data or information on any of the worksheets in the *.xla file and copy and
paste it to another regular *.xls file? If I'm not mistaken an *.xla file
is not part of the workbooks collection, so I'm wondering if what I'm asking
is impossible. Thanks!

-gk-
 
Depends on what you mean.

All of these worked ok for me:

Option Explicit
Sub testme()

Dim myAddin As Workbook
Dim wks As Worksheet

Set myAddin = Workbooks("personal.xla")

Set wks = ActiveSheet

wks.Range("a1").Value = myAddin.Worksheets("sheet1").Range("b9").Value

myAddin.Worksheets("sheet1").Range("a1:b99").Copy _
Destination:=wks.Range("b33")

myAddin.Worksheets("sheet1").Copy _
after:=wks

End Sub

But sheet1 in personal.xla was visible (when I toggled .isaddin to false for
personal.xla).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top