View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
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