Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro runtime 1004 error on opening worksheet Shaggyjh Excel Discussion (Misc queries) 5 May 6th 09 12:37 PM
Run-time error 1004: Cannot shift nonblank cells off the worksheet [email protected] Excel Discussion (Misc queries) 1 April 10th 06 06:13 PM
Set worksheet range runtime error 1004 DaveP Excel Programming 1 March 29th 05 07:13 AM
RT Error 1004, Select method of worksheet class failed Dana Sherbondy Excel Programming 2 October 1st 04 03:55 PM
How to Activate procedure with parameters ivarsb Excel Programming 3 July 27th 04 10:42 AM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"