Results 1 to 3 of 3

Issues to execute two macros on two separate workbooks (but same macros) on the same time

Threaded View

  1. #1
    Registered User
    Join Date
    04-12-2017
    Location
    paris
    MS-Off Ver
    2016 pro
    Posts
    4

    Issues to execute two macros on two separate workbooks (but same macros) on the same time

    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
    Last edited by seb92; 04-13-2017 at 02:56 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Can I Show a UserForm While Other Macros Execute?
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2014, 01:38 PM
  2. [SOLVED] Getting Run time error '9' from macros in similar workbooks.
    By garysallred in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2014, 08:38 AM
  3. Trying to execute 2 macros in 2 separate cells
    By pagnasty1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-30-2012, 11:42 PM
  4. Execute multiple macros (4) simultaneously?
    By JP Romano in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2010, 05:38 PM
  5. Execute a macros every 5 seconds
    By suppa_buster in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-30-2007, 04:01 AM
  6. Execute Macros from Other workbooks on current workbook
    By Allen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2006, 09:10 PM
  7. Execute Macros through Hyperlinks.
    By saddat@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-18-2006, 06:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1