-
Posts
16 -
Joined
-
Last visited
ironsled's Achievements
Seeker (1/7)
0
Reputation
-
ironsled reacted to a post in a topic:
Excel to Webform
-
Read Excel file cell data loop to $input
ironsled replied to ironsled's topic in AutoIt General Help and Support
@Melba, sorry. I will from now on. -
Read Excel file cell data loop to $input
ironsled replied to ironsled's topic in AutoIt General Help and Support
LOL! I didnt see that first time around. You ROCK!! Thanks again!!! I owe you many beers! -
Read Excel file cell data loop to $input
ironsled replied to ironsled's topic in AutoIt General Help and Support
When the script starts to pull the cell data, it doesnt start at number 1. It pulls from the ending number first. Example: 1 to 5 - it send the 5th row cell data. -
Read Excel file cell data loop to $input
ironsled replied to ironsled's topic in AutoIt General Help and Support
Thanks for the reply. Unfortunately, I'm over my head on this one. I've read the help files and not really sure how to format Func to work as I need it. Can you provide an example? Would I still use this code with Func? For $i = 1 To 316 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) $sCellValue2 = _ExcelReadCell($oExcel, $i, 2) $sCellValue3 = _ExcelReadCell($oExcel, $i, 3) Next Sorry for being a complete noob to this. I really want to understand what it is Im trying to do, however, its not coming to me as fast as I would like it too. Many thanks for your help!! I really appreciate it!! -
Hello, I'm currently writing a script to interact with a flash website to pull reports from a custodian. So far, the script is working. I'm wondering if it is possible to get the Excel read to loop? I've tried this script I found on the forums. #include <Excel.au3> Local $oExcel = _ExcelBookOpen(@ScriptDir & 'account.xlsx', 0, 0) For $i = 1 To 5 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next The script runs, and it pulls the 5th row data and doesn't start at 1. Im providing a sample of my script for 10 records that can be pulled when in my web session. As you can see in my code, I have to copy the code over & over, change the row number to make this work. I have over 316 records to process. There has to be a better solution than what I doing. Is there a way to do this without having to recreate lines of code for each row of data within the excel file? Many thanks to all that respond! #include <Excel.au3> Local $oExcel = _ExcelBookOpen(@ScriptDir & 'account.xlsx', 0, 0) For $i = 1 To 1 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 1 To 1 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 1 To 1 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}") For $i = 2 To 2 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 2 To 2 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 2 To 2 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}") For $i = 3 To 3 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 3 To 3 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 3 To 3 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}") For $i = 4 To 4 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 4 To 4 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 4 To 4 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}") For $i = 5 To 5 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 5 To 5 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 5 To 5 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}") For $i = 6 To 6 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 6 To 6 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 6 To 6 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}") For $i = 7 To 7 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 7 To 7 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 7 To 7 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}") For $i = 8 To 8 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 8 To 8 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 8 To 8 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}") For $i = 9 To 9 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 9 To 9 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 9 To 9 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}") For $i = 10 To 10 ;Loop $sCellValue = _ExcelReadCell($oExcel, $i, 1) ;ConsoleWrite($sCellValue & @CRLF) Next For $j = 10 To 10 ;Loop $sCellValue2 = _ExcelReadCell($oExcel, $j, 2) ;ConsoleWrite($sCellValue & @CRLF) Next For $k = 10 To 10 ;Loop $sCellValue3 = _ExcelReadCell($oExcel, $k, 3) ;ConsoleWrite($sCellValue & @CRLF) Next WinActivate ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") WinWaitActive ("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/Flex/Default.aspx[/url] - Windows Internet Explorer") Sleep (1000) MouseMove ( 1478, 180) MouseClick ("primary", 1478, 180, 1) Sleep (3000) MouseMove ( 96, 402 ) Sleep (3000) MouseClick("primary", 96, 402, 1) MouseClick("primary", 48, 416, 1) Send ( $sCellValue) Send ( "{TAB}") Send ( $sCellValue2) Send ( "{TAB}") Send ( $sCellValue3) Send ("{ENTER}") Sleep (5000) MouseMove ( 478, 402) MouseClick("primary", 478, 402, 1) Sleep (3000) Send("{CTRLDOWN}") Send("{SHIFTDOWN}") Send("s") Send("{CTRLUP}") Send("{SHIFTUP}") Sleep (1000) Send ( "w:ImagingArchivedReportsStatementsMSSB" & $sCellValue2 ) Send ("{ENTER}") winactivate("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") winwaitactive("[url="https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/"]https://mmportal.ms.com/Site/Secure/ManagerDashboard/Main/OnDemand/statements.aspx?url=http%3A/[/url] - Windows Internet Explorer") send ("!{F4}")MSSB_EXCEL.au3
-
Attach multiple files for email with variable names?
ironsled replied to ironsled's topic in AutoIt General Help and Support
Hello! Finally making some serious headway with my AutoIT project. Currently have the script prompt for 2 inputs. Im curious if I can auto name the export of the file with the 2 inputs fields. Right now I have it naming the export using: Send ( $input2 & ".pdf") Is there a way to Send $input & $input2 ".pdf" to name the file? Input = Ticket number and Input2 = CUSIP number. This would be ideal if the output of both as the name of the pdf file. Below is my script with the email portion removed. Many thanks again for your help!! DirCreate ( @DesktopDir & "Reports" ) DirCreate ( @DesktopDir & "Reports Processed" ) ;Sleep (500) Run('C:WINDOWSEXPLORER.EXE /n,/e,F:SHAREDWall Street TicketsCumberland Account.rpt') WinWaitActive("Crystal Reports - [Cumberland Account]","") $input = InputBox("CA 1Click v1.0", "Enter the Ticket Number:") ;MsgBox(0,"User input is..",$input) Send("{F5}") ControlClick("Refresh Report Data", "", "[CLASS:Button; INSTANCE:5]") ControlClick("Refresh Report Data", "", "[CLASS:Button; INSTANCE:1]") WinWaitActive("Enter Parameter Values","") Send( $input, 1 ) Send("{ENTER}") WinWaitActive("ODBC (RDO)","") ControlClick("ODBC (RDO)", "", "[CLASS:Edit; INSTANCE:2]") Send( "{bs 10}username") ControlClick("ODBC (RDO)", "", "[CLASS:Edit; INSTANCE:3]") Send( "passwd") ControlClick("ODBC (RDO)", "", "[CLASS:Button; INSTANCE:4]") WinWaitActive("Crystal Reports - [Cumberland Account]","") WinActivate("Crystal Reports - [Cumberland Account]","") $input2 = InputBox("CA 1Click v1.0", "Enter the CUSIP#") Sleep (1000) Local $answer = MsgBox(262148, "You must click YES to proceed", "Do you want to print report #" & $input & " ?" ) ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(0, "CA 1CLICK REPORTS v1.0", "OK, Bye!") Exit EndIf Send("{ALTDOWN}fpp{ALTUP}") WinActivate("Print","") Send("{ENTER}") WinWaitActive("Crystal Reports - [Cumberland Account]","Cumberland Account") Send("{ALTDOWN}fe{ALTUP}") WinWaitActive( "Export","") ControlClick("Export", "", "[CLASS:Button; INSTANCE:1]") WinWaitActive("Export Options","") ControlClick("Export Options", "", "[CLASS:Button; INSTANCE:4]") ControlClick("Export Options", "", "[CLASS:Button; INSTANCE:1]") WinWaitActive("Choose export file","") Send( "{DEL}") Send( "%userprofile%desktopreports" & $input2 & ".pdf") Send("!S") Sleep (500) WinWaitActive("Crystal Reports - [Cumberland Account]","Cumberland Account") Send( "{ALT}fx") Send( "{TAB 1}") Send( "{ENTER}") ;Sleep (500) ;$input3 = InputBox("CA 1CLICK v1.0 PDF Encryption", "Password protect report #" & $input & "? Please type password:") Run('C:Program Files (x86)Acro SoftwareCutePDF ProCutePDF.exe') WinWaitActive( "CutePDF Professional") Send("{ALT}fo") WinWaitActive("Select File:") Send("{TAB 4} {SPACE}") Send("%userprofile%desktopreports{ENTER}") WinWaitActive("Select File:") ControlClick("Select File:", "", "[CLASS:ComboBox; INSTANCE:1]") Send( $input2 & ".pdf") Send( "{ENTER}") Send( "{ALT}ts") Sleep (500) ControlClick("Standard Security", "", "[CLASS:Edit; INSTANCE:1]") Send( $input2 & ".pdf") Sleep (500) ControlClick("Standard Security", "", "[CLASS:Button; INSTANCE:3]") ControlClick("Standard Security", "", "[CLASS:Edit; INSTANCE:2]") Send( "passwd") ;Send( $input3, 1 ) Sleep (500) ControlClick("Standard Security", "", "[CLASS:Button; INSTANCE:11]") ControlClick("Password", "", "[CLASS:Edit; INSTANCE:1]") Send( "passwd") ;Send( $input3, 1 ) Sleep (500) ControlClick("Password", "", "[CLASS:Button; INSTANCE:1]") Send("{ALT}FX") Sleep (500) FileMove (@DesktopDir & "Reports*.*", @DesktopDir & "Reports Processed", 9) DirRemove (@DesktopDir & "Reports") Sleep (500) $oShell = ObjCreate("SAPI.SpVoice") ; Get the Windows SAPI Object $oShell.Speak("Good Bye") Sleep (500) ProcessClose("SciTE.exe") -
Attach multiple files for email with variable names?
ironsled replied to ironsled's topic in AutoIt General Help and Support
@Waters, Hi again! Quick question for you. Is it possible to include a signature within the email script listed below? I downloaded the OutlookEX UDF script, which I pick the signature and then copies to clipboard. This works well, but Im not sure how to go about imputing this data within this email script. Again, many thanks for your help! ;################################## ; Include ;################################## #Include<file.au3> ;################################## ; Variables ;################################## $SmtpServer = "" ; address for the smtp-server to use - REQUIRED $FromName = "" ; name from who the email was sent $FromAddress = "" ; address from where the mail should come $ToAddress = "" ; destination address of the email - REQUIRED $Subject = "" ; subject from the email - can be anything you want it to be $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = @DesktopDir & "Reports" & $input & ".pdf" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "" ; address for cc - leave blank if not needed $BccAddress = "" ; address for bcc - leave blank if not needed $Importance = "High" ; Send message priority: "High", "Normal", "Low" $Username = "" ; username for the account used from where the mail gets sent - REQUIRED $Password = "" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 25 ; port used for sending the mail $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS ;~ $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS ;################################## ; Script ;################################## Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc) EndIf ; ; The UDF Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0) Local $objEmail = ObjCreate("CDO.Message") $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then $objEmail.HTMLBody = $as_Body Else $objEmail.Textbody = $as_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) ;~ ConsoleWrite('@@ Debug : $S_Files2Attach[$x] = ' & $S_Files2Attach[$x] & @LF & '>Error code: ' & @error & @LF) ;### Debug Console If FileExists($S_Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF) $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 then $IPPort = 25 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf If $ssl Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True EndIf ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then SetError(2) Return $oMyRet[1] EndIf $objEmail="" EndFunc ;==>_INetSmtpMailCom ; ; ; Com Error Handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) $oMyRet[0] = $HexNumber $oMyRet[1] = StringStripWS($oMyError.description, 3) ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF) SetError(1); something to check for when this function returns Return EndFunc ;==>MyErrFunc -
Attach multiple files for email with variable names?
ironsled replied to ironsled's topic in AutoIt General Help and Support
@Water, Many thanks!!! It works perfectly!!! -
Attach multiple files for email with variable names?
ironsled replied to ironsled's topic in AutoIt General Help and Support
Thank you for the reply and the link. Is it possible to use the input variable to attach the files? The same code I used to begin the script to pull up the report number and export it with the same name. Now I want to attach that same file. Example: $input = InputBox("Window title", "Enter your variable:") "$AttachFiles = "@DesktopDir & "Reports$input.pdf" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed" Thank you! -
Attach multiple files for email with variable names?
ironsled replied to ironsled's topic in AutoIt General Help and Support
@Water, Yes I asked a question on July 20th about something completely different. Which I figured out on my own. Now Im asking about "Variables" and if it is possible to use them to attach files? Curious if there is a way to use the SMTP script I see floating around on the forum within the code: $AttachFiles = @DesktopDir & "" Sorry if I went against the forum rules. It was not intended. Cheers! -
Hello, Curious if I can send a file or multiple attachments with variable naming? I have a few snips for sending email with attachments. I've tried a few methods I found here on the forum with no luck. My code so far will open a Crystal Reports file, prompt for input for the report number, then it opens, prints and exports to a folder named "Reports" on the %userprofile%\desktop\ Im currently working on the next step of prompting to email the report (after the print out is verified) - a simple yes or no. If yes, attach $input.pdf If no , abort or exit. Im working within terminal services, so the %userprofile% comes in handy. Thank you for your time. Below is my code minus the username and password. =====BEGIN===== Run('C:\WINDOWS\EXPLORER.EXE /n,/e,F:\SHARED\Wall Street Tickets\Cumberland Account.rpt') WinWaitActive("Crystal Reports - [Cumberland Account]","") $input = InputBox("Window title", "Enter your variable:") Send("{F5}") WinWaitActive("Refresh Report Data","") Send("{TAB}{TAB}{DOWN}{ENTER}") WinWaitActive("Enter Parameter Values","") Send( $input, 1 ) Send("{ENTER}") WinWaitActive("ODBC (RDO)","") Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}username{TAB}password{ENTER}") WinWaitActive("Crystal Reports - [Cumberland Account]","") WinActivate("Crystal Reports - [Cumberland Account]","") Send("{ALTDOWN}fpp{ALTUP}") WinActivate("Print","") Send("{ENTER}") WinWaitActive("Crystal Reports - [Cumberland Account]","") WinWaitActive("Crystal Reports - [Cumberland Account]","") Send("{ALTDOWN}fe{ALTUP}") WinWaitActive("Export","") Send("{ENTER}") WinWaitActive("Export Options","") Send("{ENTER}") WinWaitActive("Choose export file","") Send("{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}") WinWaitActive("Choose export file","") Send("{SHIFTDOWN}5{SHIFTUP}userprofile{SHIFTDOWN}5{SHIFTUP}\desktop\reports{ENTER}") Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{DEL}") Send( $input, 1) Send("{ENTER}") =====END=====
-
Partially resolved. Not sure why this is happening within Terminal Services. I created new code as a typical user within the terminal services session. I able to run this from other users sessions now. However, Im still having a few quirks here and there. All this time I though code was code. Guess I will look at my permission settings per file? Anyone else have experience with using AutoIt within a terminal services environment / crystal reports? The forum said something about only allowed 3 posts. Hopefully this will change if I need to respond. Thanks in advance for all responses.