Error 1004 from worksheet activate procedure

  • Thread starter Thread starter mikeburg
  • Start date Start date
M

mikeburg

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
 
why bother selecting the sheet? That is probably where you error lies.

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

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top