Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 1004 from worksheet activate procedure
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro runtime 1004 error on opening worksheet | Excel Discussion (Misc queries) | |||
Run-time error 1004: Cannot shift nonblank cells off the worksheet | Excel Discussion (Misc queries) | |||
Set worksheet range runtime error 1004 | Excel Programming | |||
RT Error 1004, Select method of worksheet class failed | Excel Programming | |||
How to Activate procedure with parameters | Excel Programming |