Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Copying a Worksheet from an Addin

Is it possible in a macro/vba to copy an entire WorkSheet from an Addin to a
workbook?
--
Trefor
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copying a Worksheet from an Addin

Temporarily change the .isaddin to false, copy the sheet, and then change
..isaddin back to true.

dim myAddin as workbook
set myaddin = workbooks("something.xla")
myaddin.isaddin = false
myaddin.worksheets(1).copy _
befo=myotherworkbook.worksheets(1)
myaddin.isaddin = true




Trefor wrote:

Is it possible in a macro/vba to copy an entire WorkSheet from an Addin to a
workbook?
--
Trefor


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Copying a Worksheet from an Addin

Dave,

Thanks for the reply. I have two questions for you.

1. Can the code reside in the addin?
2. If the addin is password protected will your code work?

--
Trefor


"Dave Peterson" wrote:

Temporarily change the .isaddin to false, copy the sheet, and then change
..isaddin back to true.

dim myAddin as workbook
set myaddin = workbooks("something.xla")
myaddin.isaddin = false
myaddin.worksheets(1).copy _
befo=myotherworkbook.worksheets(1)
myaddin.isaddin = true




Trefor wrote:

Is it possible in a macro/vba to copy an entire WorkSheet from an Addin to a
workbook?
--
Trefor


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copying a Worksheet from an Addin

What happens when you tried it?

And if the code is in the same addin with the sheet to be copied, you can drop
the myAddin variable and just use ThisWorkbook.


Trefor wrote:

Dave,

Thanks for the reply. I have two questions for you.

1. Can the code reside in the addin?
2. If the addin is password protected will your code work?

--
Trefor

"Dave Peterson" wrote:

Temporarily change the .isaddin to false, copy the sheet, and then change
..isaddin back to true.

dim myAddin as workbook
set myaddin = workbooks("something.xla")
myaddin.isaddin = false
myaddin.worksheets(1).copy _
befo=myotherworkbook.worksheets(1)
myaddin.isaddin = true




Trefor wrote:

Is it possible in a macro/vba to copy an entire WorkSheet from an Addin to a
workbook?
--
Trefor


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Copying a Worksheet from an Addin

try this in the immediate window:

workbooks("funcres.xla").Sheets(1).copy

sure you have to make it not an addin?

--
Regards,
Tom Ogilvy


"Dave Peterson" wrote:

Temporarily change the .isaddin to false, copy the sheet, and then change
..isaddin back to true.

dim myAddin as workbook
set myaddin = workbooks("something.xla")
myaddin.isaddin = false
myaddin.worksheets(1).copy _
befo=myotherworkbook.worksheets(1)
myaddin.isaddin = true




Trefor wrote:

Is it possible in a macro/vba to copy an entire WorkSheet from an Addin to a
workbook?
--
Trefor


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copying a Worksheet from an Addin

Er, nope.

I must have been thinking of something else (or not thinking at all!)

Tom Ogilvy wrote:

try this in the immediate window:

workbooks("funcres.xla").Sheets(1).copy

sure you have to make it not an addin?

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote:

Temporarily change the .isaddin to false, copy the sheet, and then change
..isaddin back to true.

dim myAddin as workbook
set myaddin = workbooks("something.xla")
myaddin.isaddin = false
myaddin.worksheets(1).copy _
befo=myotherworkbook.worksheets(1)
myaddin.isaddin = true




Trefor wrote:

Is it possible in a macro/vba to copy an entire WorkSheet from an Addin to a
workbook?
--
Trefor


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copying a Worksheet from an Addin

I know what I was thinking.

If I'm copying a worksheet from an addin to an addin (maybe the same addin),
then the receiving addin can't be an addin. Good gawd. That's a terrible
sentence.

The workbook receiving the new sheet can't be an addin.

But that really comes down to the receiving workbook has to be visible (not
really a problem with the .isaddin property).





Dave Peterson wrote:

Er, nope.

I must have been thinking of something else (or not thinking at all!)

Tom Ogilvy wrote:

try this in the immediate window:

workbooks("funcres.xla").Sheets(1).copy

sure you have to make it not an addin?

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote:

Temporarily change the .isaddin to false, copy the sheet, and then change
..isaddin back to true.

dim myAddin as workbook
set myaddin = workbooks("something.xla")
myaddin.isaddin = false
myaddin.worksheets(1).copy _
befo=myotherworkbook.worksheets(1)
myaddin.isaddin = true




Trefor wrote:

Is it possible in a macro/vba to copy an entire WorkSheet from an Addin to a
workbook?
--
Trefor

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Copying a Worksheet from an Addin

Tom,

Thankyou for your reply.

I was trying to copy a sheet from an Addin to a workbook and I thought this
was going to be a lot more tricky, but in fact it works fine with making my
addin a workbook.

--
Trefor


"Tom Ogilvy" wrote:

try this in the immediate window:

workbooks("funcres.xla").Sheets(1).copy

sure you have to make it not an addin?

--
Regards,
Tom Ogilvy


"Dave Peterson" wrote:

Temporarily change the .isaddin to false, copy the sheet, and then change
..isaddin back to true.

dim myAddin as workbook
set myaddin = workbooks("something.xla")
myaddin.isaddin = false
myaddin.worksheets(1).copy _
befo=myotherworkbook.worksheets(1)
myaddin.isaddin = true




Trefor wrote:

Is it possible in a macro/vba to copy an entire WorkSheet from an Addin to a
workbook?
--
Trefor


--

Dave Peterson

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Copying a Worksheet from an Addin

Dave,

Thankyou for your reply.

I was trying to copy a sheet from an Addin to a workbook and I thought this
was going to be a lot more tricky, but in fact it works fine withOUT making
my addin a workbook.

--
Trefor


"Dave Peterson" wrote:

I know what I was thinking.

If I'm copying a worksheet from an addin to an addin (maybe the same addin),
then the receiving addin can't be an addin. Good gawd. That's a terrible
sentence.

The workbook receiving the new sheet can't be an addin.

But that really comes down to the receiving workbook has to be visible (not
really a problem with the .isaddin property).





Dave Peterson wrote:

Er, nope.

I must have been thinking of something else (or not thinking at all!)

Tom Ogilvy wrote:

try this in the immediate window:

workbooks("funcres.xla").Sheets(1).copy

sure you have to make it not an addin?

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote:

Temporarily change the .isaddin to false, copy the sheet, and then change
..isaddin back to true.

dim myAddin as workbook
set myaddin = workbooks("something.xla")
myaddin.isaddin = false
myaddin.worksheets(1).copy _
befo=myotherworkbook.worksheets(1)
myaddin.isaddin = true




Trefor wrote:

Is it possible in a macro/vba to copy an entire WorkSheet from an Addin to a
workbook?
--
Trefor

--

Dave Peterson


--

Dave Peterson


--

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
Sorting an Addin Worksheet MSweetG222 Excel Programming 5 July 13th 06 02:26 PM
Worksheet visible in an addin ? DS NTE Excel Programming 4 August 26th 05 08:06 PM
Copying a sheet from an addin into an open workbook OkieViking Excel Programming 2 April 17th 05 07:39 PM
Copying a Worksheet from an AddIn into an empty Workbook Manuel Jörges Excel Programming 1 February 24th 04 02:40 PM
Access to Worksheet in AddIn.xla Robin Clay[_3_] Excel Programming 3 December 10th 03 01:05 PM


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

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"