Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Question about worksheets in an AddIn

Can the worksheets in an AddIn be copied to another workbook? I'd test
this, but I really don't want to convert my .xls to an .xla just yet.

Windows XP Pro
Excel 2002

Thank!

-gk-

=================================================
The creative act is not the province of remote oracles or rarefied geniuses
but a transparent process that is open to everyone.
-Greg Kot in Wilco Learning How To Die-



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Question about worksheets in an AddIn

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.

--
Jim
"42N83W" wrote in message
...
Can the worksheets in an AddIn be copied to another workbook? I'd test
this, but I really don't want to convert my .xls to an .xla just yet.

Windows XP Pro
Excel 2002

Thank!

-gk-

=================================================
The creative act is not the province of remote oracles or rarefied
geniuses
but a transparent process that is open to everyone.
-Greg Kot in Wilco Learning How To Die-





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Question about worksheets in an AddIn


"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-


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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-




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Question about worksheets in an AddIn

Option Explicit
Sub testme()

Dim wkbk As Workbook

Set wkbk = Workbooks.Add(1)

With ThisWorkbook
.IsAddin = False
.Worksheets("sheet1").Copy _
befo=wkbk.Worksheets(1)
.Worksheets("sheet2").Copy _
befo=wkbk.Worksheets(1)
.Worksheets("Sheet3").Copy _
befo=wkbk.Worksheets(1)
.IsAddin = True
End With
End Sub

You may want to consider creating a new workbook that's set up exactly the way
you want--save it as a nice template and distribute it with your addin. Then
you can just create a new workbook based on that template workbook.

Option Explicit
Sub testme()
Dim wkbk As Workbook
Set wkbk = Workbooks.Add(template:=ThisWorkbook.Path & "\" & "book2.xls")
End Sub



42N83W wrote:

"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-


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about worksheets in an AddIn 42N83W Excel Programming 0 April 16th 05 02:27 PM
Question about accessing worksheets on an AddIn file 39N95W Excel Programming 1 May 25th 04 03:11 AM
looping through worksheets from addin Paul Robinson Excel Programming 0 October 9th 03 05:12 PM
looping through worksheets from addin jason Excel Programming 1 October 9th 03 01:09 PM
looping through worksheets from addin Cliff Myers Excel Programming 0 October 9th 03 06:45 AM


All times are GMT +1. The time now is 05:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"