View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Matthew Herbert Matthew Herbert is offline
external usenet poster
 
Posts: 56
Default subalterne sub in parallel

On Jul 16, 1:43*pm, pls123 wrote:
hi matthew !! tx for your help..
screen updating =false and calculation is manual .

tthere is a for * *next...

for each page begginning with A,
save and close...

all this operation takes many seconds...
while the other pages are not calculated in real time as needed...

so the problem is that thesubshould be executed "inparallel" with the
mainsub..........



"Matthew Herbert" wrote:
On Jul 15, 4:59 am, pls123 wrote:
hello all..!!
at 19.43 *my mainsublaunch a
close A *subthat closes all the pages that begin with letter A.


the problem is that these pages are many, and the closing process takes
20-30 seconds... and thesubalternesubmust be ended before the mainsubcan
prosecute... jumping many *calculations cycles


is there a way to indicate to excel that thesubalternesubmust be executed
inparallel* ??? *ty all


pls123,


In terms of "speed" you may want to consider setting ScreenUpdating to
FALSE and Calculation to xlCalculationManual (reset if necessary at
the end of the procedure). *You can also set DisplayAlerts to FALSE to
avoid from having the sheet deletion dialog box from prompting the
user (reset after each sheet deletion). *I'm not sure that I follow
your order of events, i.e. delete a sheet, run the second procedure,
go to the next sheet, delete the sheet, run the seond procedure, etc.


Best,


Matthew Herbert- Hide quoted text -


- Show quoted text -


Pls123,

As far as I know, there is no way of executing two or more procedures
simultaneously. (I have never tried this, but I guess you could open
two instances of Excel and try executing one macro in the first
instance and the other macro in the second instance. Again, I have no
idea whether this may work).

Also, you can try changing your worksheet deletion For...Next to a For
Each...Next. This should give you some more speed, but if you are
doing a Save and Close after each page deletion then yes, the process
will be somewhat slow.

Best,

Matt