Forum Discussion

Audrey's avatar
Occasional Contributor
3 years ago

Insert picture in Excel

Hi, may i know how to insert picture in excel using keyword test? I notice there are limited operations for excel in keyword test

4 Replies

  • AlexKaras's avatar
    Champion Level 3



    No way to do this via existing set of operations for keyword tests. Only through the code.


  • Hello,


    Can somebody please help on  how to insert picture in Excelsheet , through code?.



  • rraghvani's avatar
    Champion Level 3

    In your Project properties, add the WndClass name of the ribbon to MSAA in Open Applications. I’m using Excel 365 and my WndClass is called ‘NetUIHWND’. TestComplete will then recognise each of the menu items in the ribbon.

    Record your keyword test as click Insert -> Pictures -> select file -> Insert

    The same can be applied when scripting

    function Test8()
      Aliases.EXCEL.dlgInsertPicture.OpenFile("C:\\Users\\Test\\Pictures\\Smartbear.jpg", "All Pictures (*.emf;*.wmf;*.jpg;*.jpeg;*.jfif;*.jpe;*.png;*.bmp;*.dib;*.rle;*.gif;*.emz;*.wmz;*.tif;*.tiff;*.svg)");