ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Question about accessing worksheets on an AddIn file (https://www.excelbanter.com/excel-programming/299352-question-about-accessing-worksheets-addin-file.html)

39N95W

Question about accessing worksheets on an AddIn file
 
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-





Dave Peterson[_3_]

Question about accessing worksheets on an AddIn file
 
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).



39N95W wrote:

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-


--

Dave Peterson



All times are GMT +1. The time now is 04:04 AM.

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