Mian Posted December 17, 2015 Posted December 17, 2015 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.
Moderators JLogan3o13 Posted December 18, 2015 Moderators Posted December 18, 2015 Hi, @Mian welcome to the forum. The snippet below works just fine for me:#include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\1.xls") _Excel_RangeDelete($oWorkbook.ActiveSheet, "B:B", $xlShiftToLeft) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Mian Posted December 20, 2015 Author Posted December 20, 2015 @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)
water Posted December 20, 2015 Posted December 20, 2015 It is always a good idea to use the UDFs that come with Autoit to automate Office.Automating the GUI might interfere with user actions, using COM (most of the time) does not. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Mian Posted December 21, 2015 Author Posted December 21, 2015 very true @water. thats why I posted the question I had another question posted, can you please have a look of that too.
water Posted December 21, 2015 Posted December 21, 2015 If you are talking aboutthen I have already added a comment. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Moderators JLogan3o13 Posted December 21, 2020 Moderators Posted December 21, 2020 @benmartin9920 Did you not see that this thread is over 5 years old? Please STOP resurrecting old threads. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now