1

I have workbook made to create 3 excel instances and run the program in each one. I make it to improve the performance using multiple cores. I'm trying to run it without struggle in a different scope.

Example of code

Sub Initiate()
Dim spath2 As String
Dim spath3 As String
Dim xlApp As Application
Dim xlFFQ1 As Application
Dim xlFFQ2 As Application
Dim xlFFQ3 As Application


Application.ScreenUpdating = False
Application.DisplayAlerts = False

spath1 = ThisWorkbook.Path & "\program1.xlsm"
spath2 = ThisWorkbook.Path & "\program2.xlsm"
spath3 = ThisWorkbook.Path & "\program3.xlsm"

Set xlApp1 = CreateObject("Excel.Application")
Set xlApp2 = CreateObject("Excel.Application")
Set xlApp3 = CreateObject("Excel.Application")

xlApp1.Workbooks.Open (spath1)
xlApp2.Workbooks.Open (spath2)
xlApp3.Workbooks.Open (spath3)


'those lines are independents and want to run each one without waiting the end of another. xlApp1/xlApp2/xlApp3 are different excel instances
xlApp1.Run "doMyStuffs"
xlApp2.Run "doMyStuffs"
xlApp3.Run "doMyStuffs"

If something isn't quite clear, just say that I make it better written.

Community
  • 1
  • 1
Rajivdmo
  • 45
  • 6

1 Answers1

0

I used the Task Scheduler as starter of my instances. More info here:

Rajivdmo
  • 45
  • 6