-
Posts
15 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Mian's Achievements

Seeker (1/7)
0
Reputation
-
I wrote a script which deletes a single or range of columns from an excel file, however, I found that the file is frequently modified and the automation is not smooth. The task can be achieved in two ways, please help me in whichever is simple. 1) Instead of column number, I delete single column or range of columns on the basis of heading in the first cell of the column. This way I will be able to select the desired columns even if the column number changes. 2) I select the columns on the basis of heading in the first cell of each column and paste it in a new sheet or new excel file. This way I will get the desired column where ever they are in the file. Thanks
-
Executing an SISS package through autoit
Mian replied to Mian's topic in AutoIt General Help and Support
Thanks for the tip, I will try it. I also found that there is a command line utility DTexec.exe, which can run the SSIS package from commandline. I created the batch script and added it to the task scheduler. -
I wrote the following script. I have similar scripts to open internet explorer and excel when the user is not logged in and they work fine. The following script which opens an SSIS package and execute it is working fine when the user is logged in but stop working when the user is logged off. It stops after opening the SSIS package. I dont know why controlsend is working in the other two scripts but not in this one. Please help. ShellExecute("C:\Users\xyz\Desktop\exescripts\PackageToUploadDataToSqlServer.dtsx") sleep(5000) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(500) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(500) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(500) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(500) ControlSend("Execute Package Utility", "", "", "{ENTER}") sleep(50000) ControlSend("Package Execution Progress", "", "", "{TAB}") sleep(1000) ControlSend("Package Execution Progress", "", "", "{ENTER}") sleep(1000) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(1000) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(1000) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(1000) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(1000) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(1000) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(1000) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(1000) ControlSend("Execute Package Utility", "", "", "{TAB}") sleep(1000) ControlSend("Execute Package Utility", "", "", "{ENTER}") sleep(1000) Exit
-
Thanks Jos. It worked, you are great. Here is the code if another novice like me get into this problem. #include <Excel.au3> #include <Array.au3> #include <String.au3> #include <IE.au3> local $oIE =_IECreate ("https://example.com/export") sleep(5000) ControlSend("Internet Explorer", "", "", "{TAB}") ControlSend("Internet Explorer", "", "", "{TAB}") sleep(1000) ControlSend("Internet Explorer", "", "", "{ENTER}") sleep(1000) ControlSend("Save As", "", "", "PatientsData.csv") sleep(1000) ControlSend("Save As", "", "", "{TAB}")ControlSend("Save As", "", "", "{TAB}")ControlSend("Save As", "", "", "{TAB}")sleep(1000) ControlSend("Save As", "", "", "{ENTER}") sleep(1000) ControlSend("Confirm Save As", "", "", "{TAB}") sleep(1000) ControlSend("Confirm Save As", "", "", "{ENTER}") sleep(5000) RunWait('taskkill /F /IM "iexplore.exe"') ;_IEQuit($oIE) Exit
-
ok trying , but if the window is not appearing then how controlsend will work?
-
Ok my knowledge was limited in running windows gui tasks from scheduled task. The problem is that desktop goes away when user logout and my script needs desktop to show the window. Since no desktop the script keep waiting. The easiest solution (until I found another way) I can think of is to automate a remote session at the specific time from my office to the server. Steps1 Create autoit script to login into the server from 2am to 3am. Step 2 Schedule it to run every night Step 3 Scedule the scripts to run between 2:10am to 2:50am. Step 4 Exit the session.
-
#include <Excel.au3> #include <Array.au3> #include <String.au3> #include <IE.au3> local $oIE =_IECreate ("https://example.com/export") sleep(5000) WinWait("Internet Explorer") WinActivate("Internet Explorer") send("{TAB 2}") sleep(1000) send("{ENTER}") sleep(1000) WinWait("Save As") WinActivate("Save As") send("PatientsData.csv") sleep(1000) send("{TAB 3}") sleep(1000) send("{ENTER}") sleep(1000) WinWait("Confirm Save As") WinActivate("Confirm Save As") send("{TAB 1}") sleep(1000) send("{ENTER}") WinWait("Blank Page - Internet Explorer") WinActivate("Blank Page - Internet Explorer") sleep(1000) RunWait('taskkill /F /IM "iexplore.exe"') Exit I have written the above simple script, which open a link and save it to the disk. I execute it and every thing works fine. I scheduled it in windows task and it executed fine. However when I scheduled it and I logged out of the system it stops working. The scheduled start the task.exe. Open the internet explorer send f2 to open the save as dialogue and after that it fails to send the tab. Since partial script is execute therefore I think that the problem is not related to permissions. The script stops at second or third line.
-
How to click a link on a website by its text
Mian replied to Mian's topic in AutoIt General Help and Support
I got the following error when tried to use _IELinkClickByText(). Any suggestions? --> IE.au3 T3.0-2 Warning from function _IELinkClickByText, $_IESTATUS_NoMatch -
The following code open a website, wait for 10 seconds to make sure that the website is loaded. It then scrolls down 5 times and then click a specific location on the screen where a link is situated. There are two problems I want to remove. Problem 1: It is working but it is not a good approach. I know AutoIt provides a facility where a user can search for the text to click it. For example <a href="example.com"> click here to go to example.com </a> then we can ask autoit to click the link "click here to go to example.com" on loading the page. Problem 2: Instead of waiting for specific time e.g. 10 seconds, it would be better to perform the click action after the page is loaded fully. Global $MOUSE_WHEEL_DOWN1 = "Down" ShellExecute("chrome.exe", "https://example.com","","") ; To open the example.com page in google chrome. WinWait('example - Google Chrome') sleep(10000) ; wait for ten seconds to make sure the page is loaded WinActivate('example - Google Chrome') WinSetState("[ACTIVE]", "", @SW_MAXIMIZE) ; Maximize the window to make sure the clicking place is right each time sleep(1000) ; wait for maximize window MouseWheel($MOUSE_WHEEL_DOWN1, 5) ; scroll down the page because the link is at the bottom of the page sleep(1000) MouseClick('primary', 1295,312) ; click the text of the link to open the next page. e.g. "click here to go to next page"
-
Thank you @water for your quick reply. The file I am working is a long file of more than 200 columns but any csv will do. In fact it doesnt matter that what file I am opening. All I need is to save a file opened in excel as excel file. But for you I am adding the sample csv I downloaded from https://support.spatialkey.com/spatialkey-sample-csv-data/ FL_insurance_sample.csv
-
Hi my question is how can I save a file as xls type. For example at the moment I am using the following code which is saving a file as an xls format after it is modified in excel. ; Script to save document. send("{f12}") ; this code open the save as dialog box in excel sleep(3000) Send("{TAB 1}"); this code select the save as type option sleep(3000) Send("M") ; this code select the type as xls format sleep(3000) Send("{TAB 6}"); this code click the save button Send("S") ; this code click the save button sleep(3000) WinWait('Confirm Save As') ; this code wait until the confirmation pop up appears WinActivate('Confirm Save As') ; this code activate the save as pop up Send("{TAB 1}") ; this code select the yes button Send("{ENTER}") ; this code click the save button to overwrite the previously saved file.
-
very true @water. thats why I posted the question I had another question posted, can you please have a look of that too.
-
@JLogan3o13 Thank you for the solution. I used the following code to remove the column but I will update my code now ; ; To remove the excluded column ; send("^g") ; ^ is for CTRL sleep(500) WinWait("Go To") sleep(500) WinActivate("Go To") sleep(500) ;send("R") send("G1") sleep(500) Send("{TAB 3}") sleep(500) Send("{ENTER}") sleep(500) send("^{SPACE}") sleep(500) send("^-") sleep(500)
-
If I am not wrong _Excel_RangeDelete() function is used to delete rows/columns/cells from the excel file. In the manual page there are examples of deleting range and rows but I found not a single example of deleting a whole column. I tried this _Excel_RangeDelete($oExcel, "1") but no success. Please help.
-
Hi, I am new to AutoIT but I have many years of IT experience. I searched a lot for saving the document as xls and xlsx file but no success. The following is my code. Please help. #include <Excel.au3> Global $oExcel="D:\ChromeDownloads\abc.csv" $prog_excel = _Excel_Open() ;opens a new instance of the Excel software sleep(5000) $workbook = _Excel_BookOpen($prog_excel, $oExcel) ; open an existing excel file $oExcel.ActiveWorkbook.SaveAs ( "D:\ChromeDownloads\abc.xlsx",50,"","",False,False) ;_Excel_BookSaveAs($oExcel, "D:\ChromeDownloads\abc", "xlWorkbookDefault", True) ;_Excel_BookClose($oExcel, 1, 0) ;This method will save then Close the file, without any of the normal prompts, regardless of changes