Hi Everyone,
Would you know how to open a workbook in another excel instance.
I need to run 2 things side by side. At the moment, I manually do it, but wonder if I could put that in my code.
any idea, could be useful!
Thankfully,
-Phil
Hi Everyone,
Would you know how to open a workbook in another excel instance.
I need to run 2 things side by side. At the moment, I manually do it, but wonder if I could put that in my code.
any idea, could be useful!
Thankfully,
-Phil
You can use:
for example.Please Login or Register to view this content.
Remember what the dormouse said
Feed your head
thanks Romperstomper,
I'll try that as soon as I finish running my current macro.
Thanks again.
I tried that:I can see Excel is thinking, but it does not open. Would you know if there is anything I missed?HTML Code:
thanks again for your previous suggestion.
-Phil
Try making the new instance of Excel visible, then you can see what's happening in it when you open the workbook.
If posting code please use code tags, see here.
I also tried
but I am missing something.HTML Code:
Last edited by mortphil; 06-26-2014 at 04:58 AM.
sorry, norie. I posted the above before seeing that you replied.
Where can I set it to visible. Is there a line of code or should I go in excel options.
I keep digging, thanks
for instance. I tend to use other instances only for background processing so don't usually show them.Please Login or Register to view this content.
Add this after the line that creates the new instance.
You should now be able to see if anything, eg an update links dialog, is causing the new instance of Excel to hang.Please Login or Register to view this content.
Awesome, Thanks guys.
I did not know about this "New Excel.Application". I will use it a lot !
If I want to refer to a macro that is within that workbook I open in this new instance.
Can I refer to it as follows:
HTML Code:
No - you need to use run:
for example.Please Login or Register to view this content.
Thanks. I always wondered what is the difference between Run and Call.
Quite a lot.
Run breaks the call stack but also allows you to run code that Call won't (e.g. Private routines, routines in non-referenced projects).
I still have a lot to learn
I tried running my macro in the new instance. Obviously it does not work because one needs to enables macros first. I remember looking for a way to that via code but I don't think it's possible for security reasons. it looks like, I will have to click "Enable macros" when it opens.
Don't we all?
You shouldn't need to do it manually:
Please Login or Register to view this content.
Thanks that does the trick.
Now I need to rewrite my exiting macros cuz I refer to the workbook as activeworkbook and it's no longer the one active.
Thanks again for the above. EXTREMELY useful!!
Glad to help. Please remember to mark the thread solved.
mortphil
Won't the workbook you open in the new instance be the active workbook in that instance?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks