How to run macro(saved in .xlsm) in normal excel file .xlsx in Pega robotics . I have MyMacro.xlsm file which contains "showMsgBox" macro, I want to run this macro in normal excel file "Mydetails.xlsx".
This is probably more likely an Excel question. As far as I understand with Excel, the macro is part of the file. You wouldn't be able to execute a macro contained in another file with or without robotics involved.
Macros can not be saved to a non-macro Excel sheet. In order to changes this do a "save as" and change the file type to .xlsm. Once you have saved the file type you will be able to save the Macro. Please note the macros are being called through Excel by Pega so we can not change the way Excel stores macros.
You have the option to create/save macros in a macro-enabled spreadsheet in your profile area in a file that is usually called "Personal.xlsm". It's in Appdata-->Roaming-->Microsoft-->Excel if I remember correctly. So you can create your macro and save it in that directory with a known file name (e.g. MyExcelMacros.xlsm) and run it from there. It's a little trickier to write the macros for other spreadsheets, but it can be done.
Your other option is to write a script using Interop.