Hi,
first, I write from Paris so apologizes for my english.
I try to launch two macros on the same time with Excel 2016. the 2 macros are located into two separate workbook and do the same code. It works in excel2007.
I have already tried to launch each workbook into new excel instance but even with that, the two macros block themselves.
Here is the code of the macros :
Sub Lancement_Simul()
'Initialisation
Set xlapp = CreateObject("excel.application")
Dim Filename As String
Output_Doc = [Output_Rep]
Model = [Model] 'name of file .xlsm
Model_Rep = [Model_Rep] 'folder where the file is
'Suppression des check
ThisWorkbook.Activate
Worksheets("Launch").[Check_Simu].Select
Selection.ClearContents
'Ouverture du moteur de calcul
Workbooks.Open Filename:=Model_Rep & "\" & Model
' Lancement_Simul Macro
Application.DisplayAlerts = False
ThisWorkbook.Activate
For i = [Min_Simu] To [Max_Simu]
Workbooks(Model).Worksheets("HypAlm").Activate
[Simu_Stocha] = i
Application.Run "'" & Model & "'" & "!Alm"
' Alm is a other macro into another file to be executute
One excel file will call Lancement_simul() with Model as file1.xlsm
second excel file will call Lancement_simul() with Model as file2.xlsm
Separately, the both executions are ok. on the same time (but into two excel different instances), the macros blocked.
any ideas, how can I solve my issues?
thanks for your future answers.
Rgds,
seb
Bookmarks