I am trying to automate a password protected excel workbook. I was able open a password protected workbook with Open Method (4 parameters) but after that worksheet is also protected with a Form button in worksheet itself. I need to unprotect the worksheet as well. There is a Macro assigned to that button which I was able to run with RunMacro method to open “Enter Password Form” but after that the whole automation stops until I manually type the password and click “OK” or “Cancel”. I thought I was able to type password using SendKeys method but the automation doesn’t move to the next step so that I can use SendKeys. Also, I was not able to interrogate the textbox in the form just part of the form only (I am aware of limitations of interrogating an excel workbook). Please find the attachments on what I have tried so far. Let me know if you have any solution or suggestion to my problem.
***Edited by Moderator: Pallavi to update platform capability tags***
***Edited by Moderator Marissa to update SR Details***
I cannot sendkeys (both control sendkeys method and static sendwait) to the password form. The RunMacro method brings the form and automation pauses waiting for the password to be entered. It doesnot moves to the next block so that I can sendkeys. Basically, the automation doesn't continue until the password form goes away. I tested clicking "OK" and "Cancel" using test control method and it works but sendkeys doesn't.
I have already tried this. Part of the problem is automation does not move to the next step (from RunMacro method to SendKeys) so that it can execute the SendKeys Method. It hits the RunMacro method brings the enter password form and stays there. When I cancel the form then the automation hits the SendKeys Method which doesn't help because I need to use send keys when the form is present. On interrogation side, I cannot interrogate the "text box" where I can send keys in the form (as shown in my original post attachment) but right now problem I am having is before I can execute the Sendkeys. I tried WaitForEvent on the form (as shown in the attachment I uploaded with my original question) so that it recognize the form is there but again same problem.
Because RunMacro is synchronous, the wait for event will always timeout. You should call RunMacro on one thread of a parallel process and then wait for create and enter the password and close the dialog on another.
I did exactly what you have suggested (attached). It is still failing to match the control during runtime. In fact, none of the controls are matching in runtime. However, they all matched while running the adapter. I tried adding Rematch method and longer WaitForCreate (2mins) but no luck. There is no flexibility as far as match rules because I cannot use text editor and properties of the control are limited. Do I need to set any properties for adapter?
I have following properties set for the adapter:
MatchRules used-Windows style match rule (Type-child)