Posts by Ashu2019

    Shweta,


    There are multiple ways of doing it see example code below, what i have done here is assign values of a year i.e. 12 and loop it into pivot slicers with an if condition.


    you can also use for each option to loop pivot slicers too and then use the below code to loop again into the slicers fields.


    Hi Andy,


    if the events ends at midnight i.e. next day, you cannot change the date to today as it will not be correct, however if you still want to make the date as same day , simply replace the end time with 11:59 PM so that it ends the same day.

    Also the below code is collecting the events from the calendar, loading it into array and then pasting it into excel file.


    Code
    1.  For Each olApt In olfolder.items
    2. myArr(0, NextRow) = olApt.Subject ' copying subject
    3. myArr(1, NextRow) = olApt.Start 'copying start date / time
    4. myArr(2, NextRow) = replace(olApt.End,"00:00","11:59") ' replacing end time from 00:00 to 11:59
    5. myArr(3, NextRow) = olApt.Categories
    6. NextRow = NextRow + 1
    7. Next
    8. On Error GoTo 0
    9. 'Write all records to a worksheet from an array, this is much faster
    10. ws.Range("A2:D" & NextRow + 1).Value = WorksheetFunction.Transpose(myArr) ' pasting in excel sheet

    Tom, Welcome to the Forum


    like to confirm few things , does after longing into website it opens a new page?

    if it does not then the instance you set to ie is already active you can use the reference to manipulate further data.


    if no you need to loop through all ie instance to get hold of your new page example below.


    Ashish, the loop which you are using has an inner loop which makes it difficult to achieve what you desire, because for each statement runs at first and not correspondingly with another for each statement, hence you need to use do while loop statement.


    This means you need the code at first and not later why don't you use boolen expression stored in workbook hidden and use an if condition to bypass the code you want to delete, also if you are using some kind of loop use doevents to manage other events triggered by the macro

    Dear Guru's,


    I need some help with an IE automation where in I have to click on a popup dialog box as "yes" and then proceed to other procedures.


    I am stuck upon the dialog box where I am unable to get the element of the button as there is no ID of the button, as per my knowledge the popup dialog box is warped inside an iFrame > table > span > form > table > dialogbox.


    I tried every possible ways to get at the dialogbox level but failing to do so, I tried looping through all button elements of iframe still it does not gives me the button element handle.


    I do not want to use sendkeys as its not full proof, I am listing done the html code for refrence and the code I am using so far.


    Any help would be really appreciated.


    I want to click on this button.


    button title="Yes" class="x80" onclick="submitForm('DefaultFormName',1,{'_FORM_SUBMIT_BUTTON':'RemovePsYesButtonlxUkUkni'});return false" type="submit">Yes</button>


    Code
    1. <span id="OADialogPopupRN"><div><div class="x6d"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr class="xbw" valign="bottom"><td><img src="/OA_HTML/cabo/images/skyros/warnl.gif" width="18" height="18" border="0" alt=""></td><td><script>var _tURL="\x2FOA_HTML\x2Fcabo\x2Fimages\x2Fskyros\x2Ft.gif";var _axm;t(5,0)</script></td><td width="100%"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td width="100%"><h1 class="x61" type="OraHeader">Warning</h1></td></tr></table></td></tr></table></div></div><table border="0" cellspacing="0" cellpadding="0"><tr><td align="left" width="580"><span class="x1">Are you sure you want to remove 1 documents?</span></td></tr><tr><td width="580" height="20"></td></tr><tr><td align="left" width="580"><span class="x0">Documents you remove from this request will need to be resubmitted for payment.</span></td></tr></table><span style="float:left" ></span><span style="float:right" ><table cellpadding="0" cellspacing="0" border="0"><tr><td><script>t(8,0)</script></td><td><button title="No" class="x80" onclick="submitForm('DefaultFormName',1,{'_FORM_SUBMIT_BUTTON':'RemovePsNoButtonvaNLJ0xM'});return false" type="submit">No</button></td><td><button title="Yes" class="x80" onclick="submitForm('DefaultFormName',1,{'_FORM_SUBMIT_BUTTON':'RemovePsYesButtonlxUkUkni'});return false" type="submit">Yes</button></td></tr></table></span></span>