Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default How to run 2 CreateEventProc modules on 2 sheets simultaneously

Hi,

I have 2 code modules (Workcode1 n Workcode2) which have VBA code for
CreateEventProc to enter them into 2 sheets say Sheet1 n Sheet2.

i m calling them from a single module called Doit() like this:

Sub Doit()
Sheets("Sheet1").Activate
Call Workcode1
Sheets("Sheet2").Activate
Call Workcode2
End Sub

giving me Runtime error 9, subscript out of Range. I see that only
workcode1 gets added to sheet1 and not workcode2 to sheet2.

if i do the vice-versa, i see that it only adds 1 module either
workcode1 or workcode2....so i have come to the conclusion that it
does not allow 2 CreateEventProc 2 run 1 after the other....it CRASHES
EXCEL.

How do i go about rectifying this now....Any suggestions r most
welcome..

Regards

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default How to run 2 CreateEventProc modules on 2 sheets simultaneously

What line is highlited when you get the error ?

Tim

"noname" wrote in message
ups.com...
Hi,

I have 2 code modules (Workcode1 n Workcode2) which have VBA code for
CreateEventProc to enter them into 2 sheets say Sheet1 n Sheet2.

i m calling them from a single module called Doit() like this:

Sub Doit()
Sheets("Sheet1").Activate
Call Workcode1
Sheets("Sheet2").Activate
Call Workcode2
End Sub

giving me Runtime error 9, subscript out of Range. I see that only
workcode1 gets added to sheet1 and not workcode2 to sheet2.

if i do the vice-versa, i see that it only adds 1 module either
workcode1 or workcode2....so i have come to the conclusion that it
does not allow 2 CreateEventProc 2 run 1 after the other....it CRASHES
EXCEL.

How do i go about rectifying this now....Any suggestions r most
welcome..

Regards



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How to run 2 CreateEventProc modules on 2 sheets simultaneously

What is in WorkCode1 and 2?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"noname" wrote in message
ups.com...
Hi,

I have 2 code modules (Workcode1 n Workcode2) which have VBA code for
CreateEventProc to enter them into 2 sheets say Sheet1 n Sheet2.

i m calling them from a single module called Doit() like this:

Sub Doit()
Sheets("Sheet1").Activate
Call Workcode1
Sheets("Sheet2").Activate
Call Workcode2
End Sub

giving me Runtime error 9, subscript out of Range. I see that only
workcode1 gets added to sheet1 and not workcode2 to sheet2.

if i do the vice-versa, i see that it only adds 1 module either
workcode1 or workcode2....so i have come to the conclusion that it
does not allow 2 CreateEventProc 2 run 1 after the other....it CRASHES
EXCEL.

How do i go about rectifying this now....Any suggestions r most
welcome..

Regards



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default How to run 2 CreateEventProc modules on 2 sheets simultaneously

Hi Tim,

There is no line highlighted.

Both CreateEventProc Codes run perfectly well if i run them one at a
time, but they always crash Excel when i run them simultaneously.

I think its probably bcos Excel cant handle multiple calls to the same
event procedure CreateEventProc.

Is there a solution to this? As this is the only part now to finish
off my project....n i m damn stuck n frustrated by this..


Regards,



On Oct 23, 11:52 am, "Tim Williams" <timjwilliams at gmail dot com
wrote:
What line is highlited when you get the error ?

Tim

"noname" wrote in message

ups.com...

Hi,


I have 2 code modules (Workcode1 n Workcode2) which have VBA code for
CreateEventProc to enter them into 2 sheets say Sheet1 n Sheet2.


i m calling them from a single module called Doit() like this:


Sub Doit()
Sheets("Sheet1").Activate
Call Workcode1
Sheets("Sheet2").Activate
Call Workcode2
End Sub


giving me Runtime error 9, subscript out of Range. I see that only
workcode1 gets added to sheet1 and not workcode2 to sheet2.


if i do the vice-versa, i see that it only adds 1 module either
workcode1 or workcode2....so i have come to the conclusion that it
does not allow 2 CreateEventProc 2 run 1 after the other....it CRASHES
EXCEL.


How do i go about rectifying this now....Any suggestions r most
welcome..


Regards



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default How to run 2 CreateEventProc modules on 2 sheets simultaneously

Workcode1 and Workcode are 2 diff modules which have the
CreateEventProc 's for each Sheets... say Sheet1 and Sheet2.

rgds,



On Oct 23, 12:48 pm, "Bob Phillips" wrote:
What is in WorkCode1 and 2?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"noname" wrote in message

ups.com...

Hi,


I have 2 code modules (Workcode1 n Workcode2) which have VBA code for
CreateEventProc to enter them into 2 sheets say Sheet1 n Sheet2.


i m calling them from a single module called Doit() like this:


Sub Doit()
Sheets("Sheet1").Activate
Call Workcode1
Sheets("Sheet2").Activate
Call Workcode2
End Sub


giving me Runtime error 9, subscript out of Range. I see that only
workcode1 gets added to sheet1 and not workcode2 to sheet2.


if i do the vice-versa, i see that it only adds 1 module either
workcode1 or workcode2....so i have come to the conclusion that it
does not allow 2 CreateEventProc 2 run 1 after the other....it CRASHES
EXCEL.


How do i go about rectifying this now....Any suggestions r most
welcome..


Regards





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How to run 2 CreateEventProc modules on 2 sheets simultaneously

Can we see the code?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"noname" wrote in message
ups.com...
Workcode1 and Workcode are 2 diff modules which have the
CreateEventProc 's for each Sheets... say Sheet1 and Sheet2.

rgds,



On Oct 23, 12:48 pm, "Bob Phillips" wrote:
What is in WorkCode1 and 2?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"noname" wrote in message

ups.com...

Hi,


I have 2 code modules (Workcode1 n Workcode2) which have VBA code for
CreateEventProc to enter them into 2 sheets say Sheet1 n Sheet2.


i m calling them from a single module called Doit() like this:


Sub Doit()
Sheets("Sheet1").Activate
Call Workcode1
Sheets("Sheet2").Activate
Call Workcode2
End Sub


giving me Runtime error 9, subscript out of Range. I see that only
workcode1 gets added to sheet1 and not workcode2 to sheet2.


if i do the vice-versa, i see that it only adds 1 module either
workcode1 or workcode2....so i have come to the conclusion that it
does not allow 2 CreateEventProc 2 run 1 after the other....it CRASHES
EXCEL.


How do i go about rectifying this now....Any suggestions r most
welcome..


Regards





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default How to run 2 CreateEventProc modules on 2 sheets simultaneously

Sure Bob,

Tell me how i can send the file across to you....I will dump the
modules into a new workbook and send it across it to you.


Cheers!



On Oct 23, 5:25 pm, "Bob Phillips" wrote:
Can we see the code?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"noname" wrote in message

ups.com...

Workcode1 and Workcode are 2 diff modules which have the
CreateEventProc 's for each Sheets... say Sheet1 and Sheet2.


rgds,


On Oct 23, 12:48 pm, "Bob Phillips" wrote:
What is in WorkCode1 and 2?


--
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)


"noname" wrote in message


roups.com...


Hi,


I have 2 code modules (Workcode1 n Workcode2) which have VBA code for
CreateEventProc to enter them into 2 sheets say Sheet1 n Sheet2.


i m calling them from a single module called Doit() like this:


Sub Doit()
Sheets("Sheet1").Activate
Call Workcode1
Sheets("Sheet2").Activate
Call Workcode2
End Sub


giving me Runtime error 9, subscript out of Range. I see that only
workcode1 gets added to sheet1 and not workcode2 to sheet2.


if i do the vice-versa, i see that it only adds 1 module either
workcode1 or workcode2....so i have come to the conclusion that it
does not allow 2 CreateEventProc 2 run 1 after the other....it CRASHES
EXCEL.


How do i go about rectifying this now....Any suggestions r most
welcome..


Regards



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default How to run 2 CreateEventProc modules on 2 sheets simultaneously

Also wanted to know how i can AVOID the code VBE window open up, when
I run the CreateEventProc to dump the code into a Sheet. Ideally, it
should show me the Sheet not the VBE code window.

Cheers


On Oct 23, 5:25 pm, "Bob Phillips" wrote:
Can we see the code?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"noname" wrote in message

ups.com...

Workcode1 and Workcode are 2 diff modules which have the
CreateEventProc 's for each Sheets... say Sheet1 and Sheet2.


rgds,


On Oct 23, 12:48 pm, "Bob Phillips" wrote:
What is in WorkCode1 and 2?


--
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)


"noname" wrote in message


roups.com...


Hi,


I have 2 code modules (Workcode1 n Workcode2) which have VBA code for
CreateEventProc to enter them into 2 sheets say Sheet1 n Sheet2.


i m calling them from a single module called Doit() like this:


Sub Doit()
Sheets("Sheet1").Activate
Call Workcode1
Sheets("Sheet2").Activate
Call Workcode2
End Sub


giving me Runtime error 9, subscript out of Range. I see that only
workcode1 gets added to sheet1 and not workcode2 to sheet2.


if i do the vice-versa, i see that it only adds 1 module either
workcode1 or workcode2....so i have come to the conclusion that it
does not allow 2 CreateEventProc 2 run 1 after the other....it CRASHES
EXCEL.


How do i go about rectifying this now....Any suggestions r most
welcome..


Regards



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
View sheets simultaneously? Bob Newman Excel Discussion (Misc queries) 1 October 18th 07 02:57 AM
How do I unprotect multiple sheets simultaneously? ExcelPC Excel Discussion (Misc queries) 3 August 28th 06 11:15 PM
How can I protect several sheets in a workbook simultaneously? Fran crisp Excel Discussion (Misc queries) 1 June 20th 05 12:15 PM
How to apply the same background to many sheets simultaneously. Colin Hayes Excel Worksheet Functions 2 June 11th 05 02:47 PM
Search two sheets simultaneously cornishbloke[_3_] Excel Programming 1 December 12th 03 08:14 PM


All times are GMT +1. The time now is 04:26 AM.

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"