I'm receiving out of resources errors in Excel 365 (32-bit, 64-bit remedies the problem but our IT wont allow it for the number of users that would use this book, so I'm stuck with 32-bit). I have plenty of RAM so I'm trying to split the two workbooks into difference instances to allow more memory allocation (if this is a bad strategy I'd be happy to know why/alternatives!). My set-up has two workbooks, Workbook A opens Workbook B and Workbook B runs the heavy lifting code and then transfers the data back to Workbook A in value format. It worked fine before I started mucking around with the instances so I think the issue is the way I'm calling the macro in Workbook B.
WorkBook A Code:
Workbook B opens in its own instance as desired but when the code gets to the Application.Run line it opens WorkbookB again but in the same instance as WorkbookA defeating my strategy.
Is there a way I can specify the instance of excel in the Application.Run line?
Thank you!
WorkBook A Code:
Code:
Dim WkbB As Object
Set WkbB = New Excel.Application
With WkbB
.Visible = True
.Workbooks.Open "P:\Root\WorkbookB.xlsm", True, False
End With
Application.Run "'WkbB.xlsm'!Main"
Workbook B opens in its own instance as desired but when the code gets to the Application.Run line it opens WorkbookB again but in the same instance as WorkbookA defeating my strategy.
Is there a way I can specify the instance of excel in the Application.Run line?
Thank you!