I am trying to extract data from Excel form to Sap.
However the file name of the Excel name may be different every time, but the cells and format within the excel is the same. Do I have to amend the selector for all my indicate on screen?
Buddy @minthodology
you can use start process to open the excel files like this
use a assign activity like this out_filepath = Directory.GetFiles(“yourfolderpath”,“*.xlsx”)
where out_filepath is variable of type array string which will have the all the excel file in that folder
Now use a for each loop with the above variable as input and change the type argument as string in the for each loop property
inside the for each loop use a start process activity and mention the file name input as item, a variable from the for each loop, which will have the file name of each excel
from here on you can do any activities still being inside the for each loop
Kindly try this and let know buddy
Cheers @minthodology
Thank you for your reply. In my case, i open the excel file from outlook directly.
User may change the name of the excel. I do not save the excel in any folder.
Is there a way to recognize this excel form with random names each time?
Yes of course we can get the attachment name and store it to a string variable like this
–get the mails from any of the mail activity and save it to a variable of type mail messages collection
–use for each loop to iterate through each mail and you can get the attachment name Attachmentname = CType(item.Attachments.FirstOrDefault, Attachment).Name
you can use this variable any where you want where you want the attachement name to be used
This solution is too difficult for me
If i am to open the outlook myself… and open the excel file readily,
how can i have this excel file being recognize? can i like rename the selector to a wild name?
No Worries @minthodology
the above one is very simple
before you open any excel file in the mail attached with
pass this selector as a string to selector property "<wnd app='excel.exe’cls=‘XLMAIN’omit:title=’ " + Attachmentname.ToString + “*’ />”
This Attachmentname will get you the name of the file attached file…in the mail
it didnt work, i open the outlook attachment myself, not via UiPath.
not sure how it can capture attachmentname of outlook…
also i tried to edit the selector to
"<wnd app='excel.exe’cls=‘XLMAIN’omit:title=’ " + Attachmentname.ToString + “*’ />”
but when i save, it will jump back to my original selector.
Hi,
i tried to use your method and on top of that… for each excel indicate on screen… i manually removed (unchecked box) for the cls and excel title and it worked.