KAPOW

Would you like to react to this message? Create an account in a few clicks or log in to continue.
KAPOW

Welcome to the Kapow forum. Here you can get help, use your skills to help others and enjoy hanging out in the company of other Kapow Robot Developers.


2 posters

    Automate Macros

    avatar
    Tejaswini H R


    Posts : 17
    Points : 2200
    Join date : 2018-04-26

    Automate Macros Empty Automate Macros

    Post by Tejaswini H R Wed Feb 24, 2021 1:16 pm

    Hi All,

    There is a scenario where we need to automate Macro enabled excel.
    Can anybody let me know ow to automate macros in kapow?

    Regards,
    Tejaswini H R
    avatar
    nilesh@winayak.com


    Posts : 1
    Points : 1117
    Join date : 2021-03-08

    Automate Macros Empty Re: Automate Macros

    Post by nilesh@winayak.com Thu Apr 15, 2021 1:18 pm

    hello ,
    the is quite easy you just to follow few things ,first you cant either record or write macro in excel file 
    and make that file macro enable which will create .xlsm file for you ,

    now as you know there are no specific steps or dedicated activity is present in kofax rpa to execute the macro you have to do it with help of vb script

    so after creating macro you second step is to make vb script file which make sure that your macro will run
    this a sample code for running a alreay present macro in an excel


    set objExcel=CreateObject("Excel.Application")
    objExcel.Application.Run"'C:\Users\Nilesh\Desktop\macrofile.xlsm'!Module1.macro1" //excel filename followed by the macro name
    objExcel.DisplayAlerts=False
    objExcel.save  //this will save the changes which macro has made into the data
    objExcel.Application.quit//closing the excel file

    once your done with this ,the very last step is to excute that vb script.

    so the last step is to command line step and excute the vb.script file


    try this and let me know if it useful or not

      Current date/time is Thu Mar 28, 2024 11:01 pm