View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default Error 1004 from worksheet activate procedure

why bother selecting the sheet? That is probably where you error lies.

Private Sub Worksheet_Activate()
Sheets("Data").PrintPreview 'Change to Printout

End Sub

--
HTH...

Jim Thomlinson


"mikeburg" wrote:


I wanted VBA code in a worksheet called DATA to execute when I click the
tab of a worksheet called PRINT ENVELOPES of the same workbook.
Therefore, I put it in PRINT ENVELOPES worksheet activate. Naturally,
I am taking data from the DATA worksheet just left by using

sheets("data").select before each procedure. The procedure starts, but
I get the following error:

Runtime Error 1004

Application-Defined or Object Defined error

I tried leaving the code in the DATA worksheet & put a call statement
in the Print Envelopes worksheet activate section calling the
procedure. Again, the procedure starts, but I get the same error.

Any ideas?

mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=387018