Macro call from powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-1177252%22%20slang%3D%22en-US%22%3EMacro%20call%20from%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1177252%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20an%20excel%20macro%20with%20lot%20of%20formulas%20which%20takes%201%20hour%20to%20execute%20and%20get%20the%20job%20done.%3C%2FP%3E%3CP%3EI%20also%20have%20a%20powershell%20script%20that%20calls%20the%20excel%20macro.%3C%2FP%3E%3CP%3EI%20would%20like%20to%20ask%20if%20calling%20a%20macro%20from%20powershell%20can%20speedup%20the%20execution%20than%20that%20of%20excel%20or%20not%3F%3C%2FP%3E%3CP%3EI%20would%20appreciate%20any%20help%20on%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EYogendra%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1177252%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1182992%22%20slang%3D%22en-US%22%3ERe%3A%20Macro%20call%20from%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1182992%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F555081%22%20target%3D%22_blank%22%3E%40YKPS_21%3C%2FA%3E%26nbsp%3BI%20would%20say%20no%2C%20as%20calling%20it%20out%20from%20PS%20will%20execute%2Fopen%20excel%20to%20do%20it%20resulting%20in%20using%20the%20same%20resources%20and%20processes.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20order%20to%20speed%20it%20up%2C%20I%20would%20try%20to%20import%20the%20data%20into%20PS%20and%20work%20directly%20in%20there%20if%20necessary%20work%20with%20Runspaces%20to%20process%20the%20data%20in%20parallel.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Visitor

Hello All,

 

I have an excel macro with lot of formulas which takes 1 hour to execute and get the job done.

I also have a powershell script that calls the excel macro.

I would like to ask if calling a macro from powershell can speedup the execution than that of excel or not?

I would appreciate any help on this.

 

Thanks,

Yogendra

1 Reply

@YKPS_21 I would say no, as calling it out from PS will execute/open excel to do it resulting in using the same resources and processes.  

In order to speed it up, I would try to import the data into PS and work directly in there if necessary work with Runspaces to process the data in parallel.