Thread: add-in problems
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default add-in problems

Try this instead:

Private Sub Workbook_Open()
ThisWorkbook.Worksheets(1).Copy _
After:=ActiveWorkbook.Worksheets(1)
End Sub

RBS

"Jay" wrote in message
ups.com...
I am trying to copy a worksheet from my add-in to the new workbook when
excel opens. I have activated the add-in, but everytime I open Excel,
I get "Object variable or WIth variable not set".
Here is my code

Private Sub Workbook_Open()
Workbooks("Test.xla").Worksheets(1).Copy
after:=ActiveWorkbook.Worksheets(1)
End Sub