LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Automate start VB in another instance of excel and continue _without_waiting for code to finish

Hi all,

Can anyone help me out with my last step in getting multiprocessing
automated?
I want to open several instances of excel and have each instance run
VB for about 2 hours. I guess I'm halfway:

The code below starts a new instance of excel, opens the specified
file, and starts the VB.
The problem is that it will now wait till the VB code is finished,
whereas I'd like it to continue starting up the other instances..

Can anyone help me out on this one?

Regards,
Poniente



Sub XlNewInstanceWithAddins(Optional PathFile As String, Optional
StartSub As String)
Dim xl As Object
Dim ai As Object

Dim PersPath As String

PersPath = Workbooks("Personal.xls").Path


Set xl = CreateObject("Excel.Application")

On Error Resume Next

For Each ai In Application.AddIns
If ai.Installed Then
xl.Workbooks.Open(ai.FullName).RunAutoMacros 1
End If
Next

xl.Workbooks.Open PersPath & "\Personal.xls"
xl.Visible = True

If PathFile < "" Then
xl.Workbooks.Open PathFile
If StartSub < "" Then
xl.Run StartSub
End If
End If

Set xl = Nothing

End Sub

 
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
start finish dates JB2010 Excel Discussion (Misc queries) 2 September 19th 07 01:46 PM
how can I get excel to fill using a start and finish time djjom Excel Programming 1 October 7th 06 04:17 PM
Getting no of hours from start to finish Peter Mount Excel Discussion (Misc queries) 3 September 10th 06 02:11 PM
Start & Finish Time bosox9 Excel Worksheet Functions 0 July 24th 06 10:01 PM
Set up Excel to start new instance for each new file opened. Minimal_Subset Excel Discussion (Misc queries) 2 May 12th 05 01:36 AM


All times are GMT +1. The time now is 01:12 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"